Skip to content

Commit

Permalink
ensure we can get latest timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
lassemand committed Sep 17, 2024
1 parent 9f443d9 commit ac5bd3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion notification-server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion notification-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Concordium AG [email protected]"]
edition = "2021"
name = "notification-server"
version = "0.3.2"
version = "0.3.3"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 6 additions & 0 deletions notification-server/src/bin/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use std::{
path::PathBuf,
time::{Duration, Instant},
};
use std::time::{SystemTime, UNIX_EPOCH};
use axum_prometheus::metrics::gauge;
use tonic::{codegen::http, transport::ClientTlsConfig};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

Expand Down Expand Up @@ -329,6 +331,10 @@ async fn traverse_chain(
processed_height = block_height;
let delta = start.elapsed();
histogram!("block.process_successful_duration").record(delta);
if let Ok(duration_since_epoch) = SystemTime::now().duration_since(UNIX_EPOCH) {
let current_timestamp = duration_since_epoch.as_secs() as f64;
gauge!("block.process_successful_last_unix").set(current_timestamp);
}
}
Err(err) => {
error!("Error occurred while processing block: {:?}", err);
Expand Down

0 comments on commit ac5bd3a

Please sign in to comment.