-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Emit missing ingest/merge/time, ingest/merge/cpu and ingest/persists/cpu metrics
#18866
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
base: master
Are you sure you want to change the base?
Emit missing ingest/merge/time, ingest/merge/cpu and ingest/persists/cpu metrics
#18866
Conversation
- Adds the missing streaming appendator metrics for ingest/merge/time, ingest/merge/cpu and ingest/persists/cpu
Init ServiceEmitter as non-static to reuse individually for each test Add a helper in the base class for asserting segment generation metrics
ingest/merge/time, ingest/merge/cpu and ingest/persists/cpu metrics for streaming tasksingest/merge/time, ingest/merge/cpu and ingest/persists/cpu metrics
jtuglu1
left a comment
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.
LGTM – left minor comments.
| throw e; | ||
| } | ||
| finally { | ||
| metrics.incrementNumPersists(); |
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.
nit: can we move the increments below the time-sensitive metric emissions? Given we are reporting at nano-scale, chance of interrupt and/or delay due to atomic load+store can skew the nano count by X-XXns.
| identifier, | ||
| segment.getSize(), | ||
| indexes.size(), | ||
| (mergeFinishTime - startTime) / 1000000, |
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.
👍 We should probably make sure this is not being done elsewhere. For future readers, System.nanoTime() is actually more expensive than System.getCurrentTimeMillis() so if you need milli-level precision, just use the latter from the start. Milli itself is also expensive: https://pzemtsov.github.io/2017/07/23/the-slow-currenttimemillis.html
The metrics
ingest/merge/time,ingest/merge/cpuandingest/persists/cpumetrics have been documented but were previously reported as zero because they were not set in the streaming and batch appendators (it probably regressed in a refactor).These metrics are now set by the appendators and will be reported during the persist and merge phases for realtime and batch ingestion. Updated unit tests to verify that these values are emitted (non-zero values).
Also, cleaned up
KafkaIndexTaskTestandKinesisIndexTaskTestby initializing aStubServiceEmitteras a non-static member in the base classSeekableStreamIndexTaskTestBaseso it can be used by each unit test as needed.Release note
Correctly report
ingest/merge/time,ingest/merge/cpuandingest/persists/cpumetrics for streaming and batch ingestion tasks, which were previously always misreported as zero values.This PR has:
(https://github.com/apache/druid/blob/master/dev/license.md)