Skip to content

Conversation

@joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Nov 20, 2023

Description of Changes

Closes #571.

Before this patch we could only observe queue length values when prometheus sampled the metric.
This is because we were using a gauge to track the metric.
Now we are using a histogram and therefore we can observe the metric whenever it changes, regardless of sampling rate.

API and ABI breaking changes

If this is an API or ABI breaking change, please apply the
corresponding GitHub label.

Expected complexity level and risk

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.

let pool_inner = self.inner.clone();
let waiter_guard = self.waiter_gauge.inc(context);

let queue_len = WORKER_METRICS.instance_queue_length.with_label_values(
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is fine, I guess. it just makes it less easy to pull out/appraise as its own data structure. I might take a look at making this much simpler while still keeping LendingPool generic.

@joshua-spacetime joshua-spacetime merged commit be452a3 into master Nov 20, 2023
@joshua-spacetime joshua-spacetime deleted the joshua/refactor/571/queue-length-histogram branch November 20, 2023 17:43
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.

Make reducer queue length into a histogram metric

3 participants