-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add more MongoDB metrics #5273
Add more MongoDB metrics #5273
Conversation
plugins/inputs/mongodb/mongostat.go
Outdated
returnVal.ModifiedPagesEvicted = newStat.WiredTiger.Cache.ModifiedPagesEvicted | ||
returnVal.UnmodifiedPagesEvicted = newStat.WiredTiger.Cache.UnmodifiedPagesEvicted | ||
|
||
returnVal.FlushesTotalTime = float64(newStat.WiredTiger.Transaction.TransCheckpointsTotalTimeMsecs) / float64(time.Millisecond) |
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.
Our latest style for durations is to report as an integer in nanoseconds: TotalTimeMsecs * time.Millisecond
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 can't find any exists metrics in nanoseconds.
In inputs/cpu/cpu.go
time reported as float64
in seconds
.
I don't known correct type for FlushesToTotalTime
: float64
, int64
, time.Duration
, internal.Duration
or something else...
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.
The time and duration values are not nearly as uniform as I would like, though I can think of several that are using ns currently (zipkin, internal, kapacitor). In the future I would like to normalize these time datatypes more, perhaps even adding them as first class types in Telegraf.
Use int64 for the time in ns.
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.
Using nanoseconds for internal metrics storage looks reasonable (I like integers), but for external presentation IMHO is a very controversial decision. For example: prometheus recommends using seconds for time units.
Most likely, with the introduction first time and duration class types in Telegraf, the metrics output presentation would changed for some output plugins. Because of this, in addition to changing the dimension, I added the _ns suffix to metric name.
- flushes_total_time - Transaction checkpoint total time - wtcache_pages_read_info - Pages read into cache - wtcache_pages_requested_from - Pages requested from the cache - wtcache_internal_pages_evicted - Internal pages evicted - wtcache_modified_pages_evicted - Modified pages evicted - wtcache_unmodified_pages_evicted - Unmodified pages evicted
…s (`flushes_total_time_ns`)
eabacf7
to
214cf69
Compare
Rebase to master and update |
Thanks a lot. |
Required for all PRs: