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 metrics to SingleThreadedChunker #740

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timmartin-stripe
Copy link
Contributor

Context

Using a similar set of metrics to what the TimedChunker uses. It's helpful for diagnosing queue depth issues. When we switched to the SPSC queue, we were surprised the metrics were missing so I figured we could add them in.

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

Using a similar set of metrics to what the `TimedChunker` uses.  It's
helpful for diagnosing queue depth issues.  When we switched to the SPSC
queue, we were surprised the metrics were missing so I figured we could
add them in.
@@ -41,6 +50,17 @@ public SingleThreadedChunker(ChunkProcessor<T> processor, MonitoredQueue<T> iQ,
this.connectionManager = connMgr;
chunk = new Object[this.chunkSize];

MetricGroupId metricsGroup = new MetricGroupId("SingleThreadedChunker");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add an index from ctor to help identify between threads.

@@ -93,6 +115,7 @@ private void drain() {
}

processor.process(connectionManager, copy);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if the "copy" list can be converted to be an immutable list.

Copy link

github-actions bot commented Jan 8, 2025

Test Results

619 tests  ±0   609 ✅ ±0   7m 43s ⏱️ +5s
142 suites ±0    10 💤 ±0 
142 files   ±0     0 ❌ ±0 

Results for commit 99570ee. ± Comparison against base commit e886a0c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants