forked from keep-starknet-strange/madara
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add prometheus logs for da layer (keep-starknet-strange#1347)
- Loading branch information
1 parent
3ecc442
commit a5d5fdf
Showing
9 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use prometheus_endpoint::prometheus::core::AtomicU64; | ||
use prometheus_endpoint::{register, Gauge, Histogram, HistogramOpts, Opts, PrometheusError, Registry}; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct DaMetrics { | ||
pub state_updates: Histogram, | ||
pub state_proofs: Histogram, | ||
} | ||
|
||
impl DaMetrics { | ||
pub fn register(registry: &Registry) -> Result<Self, PrometheusError> { | ||
Ok(Self { | ||
state_updates: register( | ||
Histogram::with_opts(HistogramOpts::new( | ||
"madara_da_state_updates", | ||
"Histogram of time taken for state updates", | ||
))?, | ||
registry, | ||
)?, | ||
state_proofs: register( | ||
Histogram::with_opts(HistogramOpts::new( | ||
"madara_da_state_proofs", | ||
"Histogram of time taken for state proofs", | ||
))?, | ||
registry, | ||
)?, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters