Skip to content

Conversation

@alecmerdler
Copy link
Contributor

Adds two new metrics to the memory buffer which track the active number of bytes in the buffer and number of bytes that have been spilled due to reaching maximum capacity.

Resolves #574

Adds two new metrics to the 'memory' buffer which
track the active number of bytes in the buffer
and number of bytes that have been spilled due
to reaching maximum capacity.
Copy link
Collaborator

@gregfurman gregfurman left a comment

Choose a reason for hiding this comment

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

Looks good! I think we should just mention in the docs that the active_bytes and buffer_spillover are now going to be tracked. Once done, happy to approve and ship :shipit:


for (m.bytes + extraBytes) > m.cap {
if m.spilloverEnabled {
m.spilloverBytes.Incr(int64(extraBytes))
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: This Incr definitely looks like it'd benefit from generics given this unnecessary conversion 🤔

Comment on lines +132 to +133
activeBytes: res.Metrics().NewGauge("buffer_active"),
spilloverBytes: res.Metrics().NewCounter("buffer_spillover"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a note in the docs that these metrics will now be tracked?

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.

Memory buffer metrics for tracking spillover

2 participants