-
Notifications
You must be signed in to change notification settings - Fork 5
feat: track queue size in metrics/graphql #454
Conversation
Signed-off-by: Simon Paitrault <[email protected]>
2e02bd7
to
5ef7657
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release/v0.0.11 #454 +/- ##
==================================================
Coverage ? 69.49%
==================================================
Files ? 220
Lines ? 12394
Branches ? 0
==================================================
Hits ? 8613
Misses ? 3781
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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. All my comments are nits that can wait.
|
||
#[derive(Debug, Deserialize)] | ||
struct Response { | ||
// data: HashMap<String, serde_json::Value>, |
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.
Can remove I think.
@@ -232,8 +233,11 @@ impl WriteStore for FullNodeStore { | |||
} | |||
|
|||
impl ReadStore for FullNodeStore { | |||
fn count_certificates_delivered(&self) -> Result<usize, StorageError> { | |||
Ok(self.perpetual_tables.certificates.iter()?.count()) | |||
fn count_certificates_delivered(&self) -> Result<u64, StorageError> { |
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.
Maybe we should call this estimate_certs_delivered
?
@@ -33,6 +33,9 @@ pub enum InternalStorageError { | |||
#[error("Invalid query argument: {0}")] | |||
InvalidQueryArgument(&'static str), | |||
|
|||
#[error("Unexpected DB state: {0}")] | |||
UnexpectedDBState(&'static str), |
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.
It's not really a problem with the DB state if a property is missing. Wouldn't this error be for a situation where there's a new/old/incompatible rocksdb version that does not support some property?
Signed-off-by: Simon Paitrault <[email protected]> Co-authored-by: David Palm <[email protected]>
Description
This PR adds two new metrics accessible on the default port
3000
(e.g.:localhost:3000
):STORAGE_PENDING_POOL_COUNT
that tracks the number of certificates in thepending_pool
.STORAGE_PRECEDENCE_POOL_COUNT
that tracks the number of certificates in theprecedence_pool
.rocksdb
metadata:The
GraphQL
API is exposing those value undergetStoragePoolStats
.PR Checklist: