-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 indexer level task metrics to provide more visibility in the task distribution #15991
Conversation
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManagerMonitor.java
Outdated
Show resolved
Hide resolved
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.
Thanks for your first PR, @rbankar7 ! I have left some suggestions.
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManagerMonitor.java
Outdated
Show resolved
Hide resolved
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManagerMonitor.java
Outdated
Show resolved
Hide resolved
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java
Outdated
Show resolved
Hide resolved
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManagerMonitor.java
Outdated
Show resolved
Hide resolved
@Before | ||
public void setUp() | ||
{ | ||
task = createMock(Task.class); |
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.
Use NoopTask
instead of creating a mock.
taskDetails = createMock(WorkerTaskManager.TaskDetails.class); | ||
EasyMock.expect(taskDetails.getDataSource()).andReturn("dummy_DS2"); | ||
EasyMock.replay(taskDetails); | ||
taskAnnouncement = createMock(TaskAnnouncement.class); |
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.
Try to use concrete instances of TaskAnnouncement
and TaskDetails
(if needed) instead of mocks.
EasyMock.replay(taskAnnouncement); | ||
taskRunner = createMock(TaskRunner.class); | ||
taskConfig = createMock(TaskConfig.class); | ||
overlordClient = createMock(OverlordClient.class); |
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.
Use NoopOverlordClient
instead.
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.
Thanks for the update, @rbankar7 .
I have left some comments that need to be addressed.
Please update the docs to add info about the new metrics.
server/src/main/java/org/apache/druid/server/metrics/WorkerTaskCountStatsMonitor.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/druid/server/metrics/WorkerTaskCountStatsMonitorTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/druid/server/metrics/WorkerTaskCountStatsMonitorTest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/druid/server/metrics/IndexerTaskCountStatsProvider.java
Show resolved
Hide resolved
server/src/main/java/org/apache/druid/server/metrics/WorkerTaskCountStatsProvider.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/druid/server/metrics/WorkerTaskCountStatsMonitor.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/druid/server/metrics/WorkerTaskCountStatsMonitor.java
Outdated
Show resolved
Hide resolved
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java
Outdated
Show resolved
Hide resolved
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java
Outdated
Show resolved
Hide resolved
indexing-service/src/main/java/org/apache/druid/indexing/worker/WorkerTaskManager.java
Outdated
Show resolved
Hide resolved
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.
Thanks for adding the new metric and docs, @rbankar7 !
public interface IndexerTaskCountStatsProvider | ||
{ | ||
/** | ||
* The number of running tasks on an indexer |
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.
Minor suggestion for the javadocs but this can be addressed later.
* The number of running tasks on an indexer | |
* Map from datasource name to the number of running tasks on the Indexer. |
…indexerTaskCountStatsProvides
@rbankar7 , the checkstyle and |
@rbankar7 , there are more checkstyle failures. To ensure that you catch all of them, please run the following on your local machine before you commit:
|
@kfaraz I fixed the issues and verified that there are no checkstyle errors |
@rbankar7 , I ran the workflow. The test Error: Errors:
Error: org.apache.druid.server.metrics.WorkerTaskCountStatsMonitorTest.testMonitorNotMiddleManager
Error: Run 1: WorkerTaskCountStatsMonitorTest.testMonitorNotMiddleManager:288 » Configuration Guice configuration errors:
1) No implementation for org.apache.druid.server.metrics.IndexerTaskCountStatsProvider was bound.
while locating org.apache.druid.server.metrics.IndexerTaskCountStatsProvider The code coverage also seems insufficient for |
@kfaraz will fix it |
…nitorIndexer) and add tests for getting worker stats
@kfaraz looks like build is passing now |
Thanks a lot for the fix, @rbankar7 ! |
… distribution (apache#15991) Changes: Add the following indexer level task metrics: - `worker/task/running/count` - `worker/task/assigned/count` - `worker/task/completed/count` These metrics will provide more visibility into the tasks distribution across indexers (We often see a task skew issue across indexers and with this issue it would be easier to catch the imbalance)
… distribution (apache#15991) Changes: Add the following indexer level task metrics: - `worker/task/running/count` - `worker/task/assigned/count` - `worker/task/completed/count` These metrics will provide more visibility into the tasks distribution across indexers (We often see a task skew issue across indexers and with this issue it would be easier to catch the imbalance)
…re visibility (#191) * Add indexer level task metrics to provide more visibility in the task distribution (apache#15991) Changes: Add the following indexer level task metrics: - `worker/task/running/count` - `worker/task/assigned/count` - `worker/task/completed/count` These metrics will provide more visibility into the tasks distribution across indexers (We often see a task skew issue across indexers and with this issue it would be easier to catch the imbalance)
… distribution (apache#15991) (#192) Changes: Add the following indexer level task metrics: - `worker/task/running/count` - `worker/task/assigned/count` - `worker/task/completed/count` These metrics will provide more visibility into the tasks distribution across indexers (We often see a task skew issue across indexers and with this issue it would be easier to catch the imbalance)
Adds indexer level task metrics
Description
This PR adds indexer level task metrics-
These metrics will provide more visibility into the tasks distribution across indexers (We often see a task skew issue across indexers and with this issue it would be easier to catch the imbalance)
This PR has: