Skip to content

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

  • Adds an average lifetime metric
  • Separates metrics for unsent and sent transactions
  • Cleans up some naming

How this works

We now track the sum of all the times that each transaction was added to the pusher. We can then easily calculate the average addition time and compare it to the current time to calculate the average lifetime.

How this was tested

  • Locally the metrics show up as expected:
# HELP avalanche_P_vm_tx_gossip_tracking number of gossipables being tracked
# TYPE avalanche_P_vm_tx_gossip_tracking gauge
avalanche_P_vm_tx_gossip_tracking{type="sent"} 0
avalanche_P_vm_tx_gossip_tracking{type="unsent"} 0
# HELP avalanche_P_vm_tx_gossip_tracking_lifetime_average average duration a gossipable has been tracked (ns)
# TYPE avalanche_P_vm_tx_gossip_tracking_lifetime_average gauge
avalanche_P_vm_tx_gossip_tracking_lifetime_average 0
  • Metrics are updated as expected when issuing a transaction
  • CI

@StephenButtolph StephenButtolph added the monitoring This primarily focuses on logs, metrics, and/or tracing label Feb 28, 2024
@StephenButtolph StephenButtolph self-assigned this Feb 28, 2024
}
p.metrics.tracking.Set(float64(len(p.tracking)))

p.metrics.tracking.With(unsentLabels).Set(numUnsent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool

@StephenButtolph StephenButtolph merged commit 1cbea42 into gossip-cleanup Feb 28, 2024
@StephenButtolph StephenButtolph deleted the add-average-lifetime-metric branch February 28, 2024 18:26
mboben pushed a commit to mboben/avalanchego that referenced this pull request Apr 7, 2024
Co-authored-by: Dan Laine <daniel.laine@avalabs.org>
Co-authored-by: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monitoring This primarily focuses on logs, metrics, and/or tracing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants