-
Notifications
You must be signed in to change notification settings - Fork 711
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
system: fix uptime calculation #41
Conversation
Would like input from @carlpett or @brian-brazil before merging this. Also, this change makes existing exporters confused I guess since the value is radically changed, what would be best way to handle this. I would prefer semver (eg release 0.2.0 with this change?) |
Second, would it make more sense to convert this to a unix timestamp? [1] 1: https://prometheus.io/docs/practices/instrumentation/#timestamps-not-time-since |
Had a look at this - the way they calculate it in the formatted data is by using Regarding the continuity of the metric, I'm not sure. Since the previous value was broken, I'd consider it a bugfix rather than a "feature", so I don't think it needs a point release from a semver point of view. |
Generally we should always export raw data. For example there's probably a race in here in somewhere that can cause the value to fluctuate slightly. |
f8d3903
to
f3fb21c
Compare
Reworked the patch:
|
var dst []Win32_PerfRawData_PerfOS_System | ||
if err := wmi.Query(wmi.CreateQuery(&dst, ""), &dst); err != nil { | ||
var raw []Win32_PerfRawData_PerfOS_System | ||
if err := wmi.Query(wmi.CreateQuery(&raw, ""), &raw); err != nil { |
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.
Minor nitpick: Now that you aren't pulling in multiple counters, might as well revert this name to dst
, since that is what we use everywhere else (in truth, I'm not sure why we use that name, though? 😄 )
a5ddd59
to
59c760e
Compare
59c760e
to
a3f44f6
Compare
Reworked again. Now it converts the Windows timestamp into a unix timestamp. |
👍 |
…raw data doesnt change. fixes #40