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

Add more MongoDB metrics #5273

Merged
merged 3 commits into from
Jan 15, 2019
Merged

Conversation

bozaro
Copy link
Contributor

@bozaro bozaro commented Jan 10, 2019

  • flushes_total_time_ns - 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

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added this to the 1.10.0 milestone Jan 10, 2019
@danielnelson danielnelson added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/mongodb labels Jan 10, 2019
returnVal.ModifiedPagesEvicted = newStat.WiredTiger.Cache.ModifiedPagesEvicted
returnVal.UnmodifiedPagesEvicted = newStat.WiredTiger.Cache.UnmodifiedPagesEvicted

returnVal.FlushesTotalTime = float64(newStat.WiredTiger.Transaction.TransCheckpointsTotalTimeMsecs) / float64(time.Millisecond)
Copy link
Contributor

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

Copy link
Contributor Author

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...

Copy link
Contributor

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.

Copy link
Contributor Author

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
@bozaro
Copy link
Contributor Author

bozaro commented Jan 15, 2019

Rebase to master and update plugins/inputs/mongodb/README.md

@danielnelson danielnelson merged commit df33759 into influxdata:master Jan 15, 2019
@bozaro bozaro deleted the mongodb-cache-metrics branch January 15, 2019 19:35
@bozaro
Copy link
Contributor Author

bozaro commented Jan 16, 2019

Thanks a lot.

trevorwhitney pushed a commit to trevorwhitney/telegraf that referenced this pull request Feb 14, 2019
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
dupondje pushed a commit to dupondje/telegraf that referenced this pull request Apr 22, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mongodb feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants