Skip to content

Commit

Permalink
Add nanosec granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
niks3089 committed Apr 8, 2024
1 parent 0507e6b commit 0c0eb07
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions yellowstone-grpc-geyser/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,16 +812,16 @@ impl GrpcService {
Some(message) = messages_rx.recv() => {
let start_time = Instant::now();
let _guard = scopeguard::guard((), |_| {
let elapsed = start_time.elapsed().as_micros();
GEYSER_LOOP_HISTOGRAM.observe(elapsed as f64 / 1_000_000.0);
let elapsed = start_time.elapsed().as_nanos();
GEYSER_LOOP_HISTOGRAM.observe(elapsed as f64 / 1_000_000_000.0);
});
MESSAGE_QUEUE_SIZE.dec();

{
let block_update_start = Instant::now();
let _block_update_guard = scopeguard::guard((), |_| {
let elapsed = block_update_start.elapsed().as_micros();
BLOCK_UPDATE_HISTOGRAM.observe(elapsed as f64 / 1_000_000.0);
let elapsed = block_update_start.elapsed().as_nanos();
BLOCK_UPDATE_HISTOGRAM.observe(elapsed as f64 / 1_000_000_000.0);
});

// Update blocks info
Expand All @@ -836,8 +836,8 @@ impl GrpcService {
{
let remove_outdated_start = Instant::now();
let _remove_outdated_guard = scopeguard::guard((), |_| {
let elapsed = remove_outdated_start.elapsed().as_micros();
REMOVE_OUTDATED_HISTOGRAM.observe(elapsed as f64 / 1_000_000.0);
let elapsed = remove_outdated_start.elapsed().as_nanos();
REMOVE_OUTDATED_HISTOGRAM.observe(elapsed as f64 / 1_000_000_000.0);
});

match &message {
Expand Down Expand Up @@ -903,8 +903,8 @@ impl GrpcService {
{
let update_reconstruction_start = Instant::now();
let _update_reconstruction_guard = scopeguard::guard((), |_| {
let elapsed = update_reconstruction_start.elapsed().as_micros();
UPDATE_RECONSTRUCTION_HISTOGRAM.observe(elapsed as f64 / 1_000_000.0);
let elapsed = update_reconstruction_start.elapsed().as_nanos();
UPDATE_RECONSTRUCTION_HISTOGRAM.observe(elapsed as f64 / 1_000_000_000.0);
});

// Update block reconstruction info
Expand Down

0 comments on commit 0c0eb07

Please sign in to comment.