Skip to content

Commit

Permalink
Adding a metric to measure total thread cpu time for a table (#11713)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcvsubbu authored Oct 2, 2023
1 parent ae16812 commit 5308cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public enum ServerMeter implements AbstractMetrics.Meter {
NUM_SEGMENTS_PRUNED_INVALID("numSegmentsPrunedInvalid", false),
NUM_SEGMENTS_PRUNED_BY_LIMIT("numSegmentsPrunedByLimit", false),
NUM_SEGMENTS_PRUNED_BY_VALUE("numSegmentsPrunedByValue", false),
LARGE_QUERY_RESPONSES_SENT("largeResponses", false);
LARGE_QUERY_RESPONSES_SENT("largeResponses", false),
TOTAL_THREAD_CPU_TIME_MILLIS("millis", false);

private final String _meterName;
private final String _unit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ protected byte[] processQueryAndSerialize(ServerQueryRequest queryRequest, Execu
if (threadCpuTimeNs > 0) {
_serverMetrics.addTimedTableValue(tableNameWithType, ServerTimer.EXECUTION_THREAD_CPU_TIME_NS, threadCpuTimeNs,
TimeUnit.NANOSECONDS);
_serverMetrics.addMeteredTableValue(tableNameWithType, ServerMeter.TOTAL_THREAD_CPU_TIME_MILLIS,
TimeUnit.MILLISECONDS.convert(threadCpuTimeNs, TimeUnit.NANOSECONDS));
}
if (systemActivitiesCpuTimeNs > 0) {
_serverMetrics.addTimedTableValue(tableNameWithType, ServerTimer.SYSTEM_ACTIVITIES_CPU_TIME_NS,
Expand Down

0 comments on commit 5308cf0

Please sign in to comment.