-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22ac097
commit 16f2284
Showing
12 changed files
with
100 additions
and
70 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod labels; | ||
pub mod overlay; | ||
pub mod portalnet; | ||
pub mod registry; | ||
pub mod storage; |
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,16 @@ | ||
use crate::metrics::overlay::OverlayMetrics; | ||
use crate::metrics::storage::StorageMetrics; | ||
use prometheus_exporter::{self, prometheus::Registry}; | ||
pub struct PortalnetMetrics { | ||
pub overlay: OverlayMetrics, | ||
pub storage: StorageMetrics, | ||
} | ||
|
||
impl PortalnetMetrics { | ||
// remove this borrow? | ||
pub fn new(registry: &Registry) -> anyhow::Result<Self> { | ||
let overlay = OverlayMetrics::new(registry)?; | ||
let storage = StorageMetrics::new(registry)?; | ||
Ok(Self { overlay, storage }) | ||
} | ||
} |
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,12 @@ | ||
use crate::metrics::portalnet::PortalnetMetrics; | ||
use lazy_static::lazy_static; | ||
use prometheus_exporter::prometheus::Registry; | ||
|
||
lazy_static! { | ||
pub static ref METRICS_REGISTRY: PortalnetMetrics = initialize_metrics_registry(); | ||
} | ||
|
||
fn initialize_metrics_registry() -> PortalnetMetrics { | ||
let registry = Registry::new(); | ||
PortalnetMetrics::new(®istry).expect("failed to initialize metrics") | ||
} |
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
Oops, something went wrong.