Skip to content

Commit

Permalink
tweak new metrics names (_seconds instead of _secs)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed Aug 4, 2023
1 parent 19949a4 commit 31c0731
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pageserver/src/bin/pageserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use clap::{Arg, ArgAction, Command};
use fail::FailScenario;
use metrics::launch_timestamp::{set_launch_timestamp_metric, LaunchTimestamp};
use pageserver::disk_usage_eviction_task::{self, launch_disk_usage_global_eviction_task};
use pageserver::metrics::{STARTUP_DURATION, STARTUP_LOADING};
use pageserver::metrics::{STARTUP_DURATION, STARTUP_IS_LOADING};
use pageserver::task_mgr::WALRECEIVER_RUNTIME;
use remote_storage::GenericRemoteStorage;
use tokio::time::Instant;
Expand Down Expand Up @@ -349,7 +349,7 @@ fn start_pageserver(
// Up to this point no significant I/O has been done: this should have been fast. Record
// duration prior to starting I/O intensive phase of startup.
startup_checkpoint("initial", "Starting loading tenants");
STARTUP_LOADING.set(1);
STARTUP_IS_LOADING.set(1);

// Startup staging or optimizing:
//
Expand Down Expand Up @@ -394,7 +394,7 @@ fn start_pageserver(

init_done_rx.wait().await;
startup_checkpoint("initial_tenant_load", "Initial load completed");
STARTUP_LOADING.set(0);
STARTUP_IS_LOADING.set(0);

// initial logical sizes can now start, as they were waiting on init_done_rx.

Expand Down
14 changes: 7 additions & 7 deletions pageserver/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,29 +398,29 @@ pub(crate) static UNEXPECTED_ONDEMAND_DOWNLOADS: Lazy<IntCounter> = Lazy::new(||
/// different phases of startup.
pub static STARTUP_DURATION: Lazy<F64GaugeVec> = Lazy::new(|| {
register_f64_gauge_vec!(
"pageserver_startup_duration_secs",
"pageserver_startup_duration_seconds",
"Time taken by phases of pageserver startup, in seconds",
&["phase"]
)
.expect("Failed to register pageserver_startup_duration_secs metric")
.expect("Failed to register pageserver_startup_duration_seconds metric")
});

pub static STARTUP_LOADING: Lazy<UIntGauge> = Lazy::new(|| {
pub static STARTUP_IS_LOADING: Lazy<UIntGauge> = Lazy::new(|| {
register_uint_gauge!(
"pageserver_startup_loading",
"pageserver_startup_is_loading",
"1 while in initial startup load of tenants, 0 at other times"
)
.expect("Failed to register pageserver_startup_loading")
.expect("Failed to register pageserver_startup_is_loading")
});

/// How long did tenants take to go from construction to active state?
pub(crate) static TENANT_ACTIVATION: Lazy<Histogram> = Lazy::new(|| {
register_histogram!(
"pageserver_tenant_activation_secs",
"pageserver_tenant_activation_seconds",
"Time taken by phases of pageserver startup, in seconds",
CRITICAL_OP_BUCKETS.into()
)
.expect("Failed to register pageserver_tenant_activation_secs metric")
.expect("Failed to register pageserver_tenant_activation_seconds metric")
});

/// Each `Timeline`'s [`EVICTIONS_WITH_LOW_RESIDENCE_DURATION`] metric.
Expand Down

0 comments on commit 31c0731

Please sign in to comment.