kfaraz commented on code in PR #17971:
URL: https://github.com/apache/druid/pull/17971#discussion_r2071047995
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -543,9 +544,27 @@ private boolean changeTaskCount(int desiredActiveTaskCount)
desiredActiveTaskCount,
dataSource
);
+ final long scaleActionStart = System.currentTimeMillis();
gracefulShutdownInternal();
changeTaskCountInIOConfig(desiredActiveTaskCount);
clearAllocationInfo();
+ final long scaleActionEnd = System.currentTimeMillis();
Review Comment:
Use Druid `Stopwatch` instead.
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -543,9 +544,27 @@ private boolean changeTaskCount(int desiredActiveTaskCount)
desiredActiveTaskCount,
dataSource
);
+ final long scaleActionStart = System.currentTimeMillis();
gracefulShutdownInternal();
changeTaskCountInIOConfig(desiredActiveTaskCount);
clearAllocationInfo();
+ final long scaleActionEnd = System.currentTimeMillis();
+ try {
+ emitter.emit(ServiceMetricEvent.builder()
+ .setDimension("dataSource", dataSource)
Review Comment:
```suggestion
.setDimension(DruidMetrics.DATASOURCE, dataSource)
```
##########
indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamSupervisorSpecTest.java:
##########
@@ -846,6 +850,7 @@ public int getActiveTaskGroupsCount()
.map(metric ->
metric.getUserDims().get(SeekableStreamSupervisor.AUTOSCALER_SKIP_REASON_DIMENSION))
.filter(Objects::nonNull)
.anyMatch("Already at max task count"::equals));
+
Assert.assertFalse(emitter.getMetricEvents().containsKey(SeekableStreamSupervisor.AUTOSCALER_SCALING_TIME_METRIC));
Review Comment:
Use `emitter.verifyNotEmitted` instead.
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -543,9 +544,27 @@ private boolean changeTaskCount(int desiredActiveTaskCount)
desiredActiveTaskCount,
dataSource
);
+ final long scaleActionStart = System.currentTimeMillis();
gracefulShutdownInternal();
changeTaskCountInIOConfig(desiredActiveTaskCount);
clearAllocationInfo();
+ final long scaleActionEnd = System.currentTimeMillis();
+ try {
Review Comment:
No need to put this in try-catch.
##########
indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/SeekableStreamSupervisorSpecTest.java:
##########
@@ -788,6 +788,10 @@ public void testSeekableStreamSupervisorSpecWithScaleOut()
throws InterruptedExc
.map(metric ->
metric.getUserDims().get(SeekableStreamSupervisor.AUTOSCALER_SKIP_REASON_DIMENSION))
.filter(Objects::nonNull)
.anyMatch("minTriggerScaleActionFrequencyMillis not elapsed
yet"::equals));
+ Assert.assertEquals(
+ 1,
+
emitter.getMetricEvents().get(SeekableStreamSupervisor.AUTOSCALER_SCALING_TIME_METRIC).size()
+ );
Review Comment:
Use `emitter.verifyEmitted` instead.
##########
docs/operations/metrics.md:
##########
@@ -284,6 +284,7 @@ batch ingestion emit the following metrics. These metrics
are deltas for each em
|`ingest/pause/time`|Milliseconds spent by a task in a paused state without
ingesting.|`dataSource`, `taskId`, `tags`| < 10 seconds|
|`ingest/handoff/time`|Total number of milliseconds taken to handoff a set of
segments.|`dataSource`, `taskId`, `taskType`, `groupId`, `tags`|Depends on the
coordinator cycle time.|
|`task/autoScaler/requiredCount`|Count of required tasks based on the
calculations of `lagBased` auto scaler.|`dataSource`, `stream`,
`scalingSkipReason`|Depends on auto scaler config.|
+|`task/autoScaler/scaleActionTime`|Time in ms taken to complete the scale
action.|`dataSource`, `stream`|Depends on auto scaler config.|
Review Comment:
```suggestion
|`task/autoScaler/scaleActionTime`|Time taken in milliseconds to complete
the scale action.|`dataSource`, `stream`|Depends on auto scaler config.|
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]