Skip to content

detect: Considering CPU Mhz as string representation of floats#92

Open
ErwanAliasr1 wants to merge 1 commit intomasterfrom
evelu-porc
Open

detect: Considering CPU Mhz as string representation of floats#92
ErwanAliasr1 wants to merge 1 commit intomasterfrom
evelu-porc

Conversation

@ErwanAliasr1
Copy link
Contributor

When doing a match on a profile that have some Mhz defined, the float repesentation makes the matching code failing.
As of many other values, let's consider the output as a string representation of a float.
This is compatible with all the comparison operators implemented in matcher.

Signed-off-by: Erwan Velu e.velu@criteo.com

When doing a match on a profile that have some Mhz defined, the float repesentation makes the matching code failing.
As of many other values, let's consider the output as a string representation of a float.
This is compatible with all the comparison operators implemented in matcher.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
@ErwanAliasr1 ErwanAliasr1 requested a review from tbreeds June 5, 2019 15:49
Copy link
Contributor

@tbreeds tbreeds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better or worse this will break the existing API.

Can we instead add a string type ie:

                                     ('str:min_Mhz', 'CPU min MHz', ''),
                                     ('str:max_Mhz', 'CPU max MHz', ''),
                                     ('str:current_Mhz', 'CPU MHz', ''),

We should also think about how we can deprecate and change data we collect

@ErwanAliasr1
Copy link
Contributor Author

We can also view this a a failure of the matching code. Maybe I have to fix the matching code more than the reporting.

@tbreeds
Copy link
Contributor

tbreeds commented Jun 13, 2019

We can also view this a a failure of the matching code. Maybe I have to fix the matching code more than the reporting.

That's certainly possible. In what way does it fail? Perhaps we can leave the reported value a float but make it more precise? Can you for example use math.isclose ?

@elfosardo
Copy link
Collaborator

@ErwanAliasr1 is this still valid ?

@ErwanAliasr1
Copy link
Contributor Author

That's still an open point. Is this a failure of the report or the matching code.
I'd probably vote for the matching code that needs to be more clever on this.

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

Successfully merging this pull request may close these issues.

3 participants