Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is data type "time" mapped to Float #177

Open
mboyerm opened this issue Jun 8, 2022 · 4 comments
Open

Why is data type "time" mapped to Float #177

mboyerm opened this issue Jun 8, 2022 · 4 comments

Comments

@mboyerm
Copy link
Contributor

mboyerm commented Jun 8, 2022

Is there a reason why the data type "time" is mapped to Float (instead of Long)?

This creates an issue when trying to set the startDateTime attribute from the ScheduledTestSuite object.
http://nuagenetworks.github.io/vsd-api-documentation/v6/20.10.8/scheduledtestsuite.html#attr_startDateTime

@ralphmalek
Copy link

To expand on this, what I've noticed is that, when the VSPK sends this back to VSD, the output ends up being 1.234E12 rather than the long version of the value, which VSD subsequently rejects. By replacing the definition of the object with one that uses Long instead of Float, the save works correctly.

@pdumais
Copy link
Collaborator

pdumais commented Jun 9, 2022

I looked at the specs files and it looks like any places that uses "time" might be ok to be replaced by "integer". There are a few attributes that express an average time (like average RTT) but those are set as "float" instead of "time". It looks like a safe change to make but we would need to fully test all of those fields to make those changes. We need to query all fields marked as "time" and make sure they return integers. Or ask the R&D team to investigate
CC @pdellaert

@ralphmalek
Copy link

Should this be an integer or a long? Java Date represents its time in milliseconds as a long so should we be consistent with this?

We only use one of the affected classes at the moment, but I have confirmed that switching the float to a long in that case works perfectly fine when retrieving and saving the objects.

@pdumais
Copy link
Collaborator

pdumais commented Jun 9, 2022

I mean "Integer" in the mathematical sense. But yes, a long to be more precise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants