Skip to content

Conversation

@smklein
Copy link
Collaborator

@smklein smklein commented Jan 20, 2023

Attempts to improve the force_collect method on Oximeter:

/// Forces Oximeter to perform a collection immediately.
///
/// This is particularly useful during tests, which would prefer to
/// avoid waiting until a collection interval completes.
pub async fn force_collect(&self) {
self.server.app_private().force_collection().await
}

This method triggers the collection of metrics from Producers, but Oximeter is a pipeline, and this just sends an initial message, rather than ensuring that those metrics have made their way to Clickhouse.

This PR weaves an optional "token" through this pipeline, so a caller can call force_collect and confidently know "if any metrics were ready to be produced before, they'll be in Clickhouse after this call".

Fixes #2186

Copy link
Collaborator

@bnaecker bnaecker left a comment

Choose a reason for hiding this comment

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

Nice! Couple of spelling nits, but 👍 otherwise.

@smklein smklein enabled auto-merge (squash) January 20, 2023 18:32
@smklein smklein merged commit 6e39d7b into main Jan 20, 2023
@smklein smklein deleted the oximeter-better-force-collection branch January 20, 2023 19:21
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.

thread 'integration_tests::instances::test_instance_metrics' panicked at 'attempt to subtract with overflow'

3 participants