-
Notifications
You must be signed in to change notification settings - Fork 37
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
feature: add metrics/tracking to remaining agents #922
Conversation
.db | ||
.retrieve_latest_nonce(domain)? | ||
.retrieve_keyed_decodable(CURRENT_NONCE, &replica_domain)? | ||
.map(|n: u32| n + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to remove pass through methods in OpticsDB. Also felt that simple agent-unique counter stores didn't belong in OpticsDB so we just use basic db methods here
// Relay update and increment counters if tx successful | ||
if self.replica.update(&signed_update).await.is_ok() { | ||
self.updates_relayed_count | ||
.with_label_values(&[self.home.name(), self.replica.name(), AGENT_NAME]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this invocation is constant for every instance of UpdatePoller, which is why in the other PR i made for just the updater stores an already-fully-specified IntCounter
inside the UpdatePoller
instead of doing it dynamically.
doing so only avoids a single hash of all the labels, though, so 🤷🏼
@@ -140,7 +172,8 @@ impl OpticsAgent for Relayer { | |||
} | |||
let replica = replica_opt.unwrap(); | |||
|
|||
let update_poller = UpdatePoller::new(home, replica.clone(), duration); | |||
let update_poller = | |||
UpdatePoller::new(home, replica.clone(), duration, updates_relayed_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the information needed to do updates_relayed_count.with_label_values
is right here
Bad dependency but running this in prod is contingent on testing previous updater PR in dev first...
For #917