-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Accountsdb plugin metrics #20606
Accountsdb plugin metrics #20606
Conversation
3513c38
to
4c73c4e
Compare
Codecov Report
@@ Coverage Diff @@
## master #20606 +/- ##
=========================================
- Coverage 82.0% 82.0% -0.1%
=========================================
Files 494 494
Lines 137615 137633 +18
=========================================
- Hits 112884 112866 -18
- Misses 24731 24767 +36 |
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.
lgtm. Just a couple tinfoil hat nits from me
match plugin.update_account(ReplicaAccountInfoVersions::V0_0_1(&account), slot) { | ||
Err(err) => { | ||
error!( | ||
"Failed to update account {:?} at slot {:?}, error: {:?}", | ||
account.pubkey, slot, err | ||
bs58::encode(account.pubkey).into_string(), |
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.
You could alternatively use the Display
formatter instead of Debug
.
@@ -88,21 +90,31 @@ impl AccountsUpdateNotifierImpl { | |||
return; | |||
} | |||
for plugin in plugin_manager.plugins.iter_mut() { | |||
let mut measure = Measure::start("accountsdb-plugin-update-account"); | |||
match plugin.update_account(ReplicaAccountInfoVersions::V0_0_1(&account), slot) { | |||
Err(err) => { | |||
error!( | |||
"Failed to update account {:?} at slot {:?}, error: {:?}", |
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.
I think we probably want the plugin name here as well?
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.
done
account.pubkey, slot, err | ||
bs58::encode(account.pubkey).into_string(), | ||
slot, | ||
err | ||
) | ||
} | ||
Ok(_) => { | ||
trace!( | ||
"Successfully updated account {:?} at slot {:?}", |
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.
Ditto, plugin name and Display
formatter
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.
done
) | ||
} | ||
Ok(_) => { | ||
trace!( | ||
"Successfully updated account {:?} at slot {:?}", | ||
account.pubkey, | ||
bs58::encode(account.pubkey).into_string(), |
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.
Keep in mind that base58 is quite slow, so this could potentially harm performance. Probably fine at trace!
though
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.
Yes. I think it is incurred only during the trace condition
@@ -190,7 +192,7 @@ impl PostgresClient for SimplePostgresClient { | |||
) -> Result<(), AccountsDbPluginError> { | |||
debug!( |
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.
trace!
?
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.
Done
Pull request has been modified.
Thanks for addressing! One last thing. When using the |
Thanks for the info! The code is using the interface ReplicaAccountInfo which did not use the Pubkey -- just raw [u8] hence the encoding. |
Added metrics for accountsdb plugin Handle and log postgres db errors Print account pubkeys nicely in logging
Added metrics for accountsdb plugin Handle and log postgres db errors Print account pubkeys nicely in logging
This reverts commit 3aca559.
Summary of Changes
Added metrics for accountsdb plugin
Handle and log postgres db errors
Print account pubkeys nicely in logging
Fixes #