-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Attribute object that supports units and comparison #4779
Conversation
// Multiplier is the multiplier over the base unit (KiB multiplier is 1024) | ||
Multiplier int64 | ||
|
||
// InverseMultiplier specifies that the multiplier is an inverse so: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not make the multiplier a float so it works for both cases?
plugins/shared/structs/attribute.go
Outdated
} | ||
|
||
// comparitor returns the comparitor function for the attribute | ||
func (a *Attribute) comparitor() compareFn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - comparator, here and in the various functions below
"100.25mW", | ||
} | ||
|
||
// run the Fib function b.N times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid comment
// lengthSortedUnits is a list of unit names sorted by length with longest | ||
// first | ||
lengthSortedUnits = make([]string, 0, numUnits) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn;t check the conversion values below too closely, since there's no unit test and we are setting up the units here its worth a second look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checked them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had some comments
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Instead of fingerprinters emitting an opaque string, they can now emit a type attribute value. These attributes support a set of units as well. The attributes also support comparison, making the following possible:
10.5GiB < 12GB