Skip to content

Commit

Permalink
Remove metrics from new scheduler (#1116)
Browse files Browse the repository at this point in the history
In order to make the refactor easier we are removing all metrics.

We will add them back in later.
  • Loading branch information
allada authored Jul 8, 2024
1 parent e95adfc commit 3070a40
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 193 deletions.
28 changes: 0 additions & 28 deletions nativelink-scheduler/src/scheduler_state/awaited_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use nativelink_util::action_messages::{
ActionInfo, ActionInfoHashKey, ActionStage, ActionState, OperationId, WorkerId,
};
use nativelink_util::evicting_map::InstantWrapper;
use nativelink_util::metrics_utils::{CollectorState, MetricsComponent};
use parking_lot::{RwLock, RwLockReadGuard, RwLockUpgradableReadGuard, RwLockWriteGuard};
use static_assertions::{assert_eq_size, const_assert, const_assert_eq};
use tokio::sync::watch;
Expand Down Expand Up @@ -347,30 +346,3 @@ const_assert!(
AwaitedActionSortKey::new(0, 0, [0xff, 0xff, 0xff, 0xff]).0
> AwaitedActionSortKey::new(0, 0, [0; 4]).0
);

impl MetricsComponent for AwaitedAction {
fn gather_metrics(&self, c: &mut CollectorState) {
c.publish(
"action_digest",
&self.action_info.unique_qualifier.action_name(),
"The digest of the action.",
);
c.publish(
"current_state",
self.get_current_state().as_ref(),
"The current stage of the action.",
);
c.publish(
"attempts",
&self.get_attempts(),
"The number of attempts this action has tried.",
);
c.publish(
"worker_id",
&self
.get_worker_id()
.map_or(String::new(), |v| v.to_string()),
"The current worker processing the action (if any).",
);
}
}
19 changes: 2 additions & 17 deletions nativelink-scheduler/src/scheduler_state/completed_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use std::sync::Arc;
use std::time::SystemTime;

use nativelink_util::action_messages::{ActionInfoHashKey, ActionState, OperationId};
use nativelink_util::metrics_utils::{CollectorState, MetricsComponent};

/// A completed action that has no listeners.
pub struct CompletedAction {
/// The time the action was completed.
pub(crate) completed_time: SystemTime,
/// TODO!(unused?!)
pub(crate) _completed_time: SystemTime,
/// The current state of the action when it was completed.
pub(crate) state: Arc<ActionState>,
}
Expand Down Expand Up @@ -55,18 +55,3 @@ impl Borrow<ActionInfoHashKey> for CompletedAction {
&self.state.id.unique_qualifier
}
}

impl MetricsComponent for CompletedAction {
fn gather_metrics(&self, c: &mut CollectorState) {
c.publish(
"completed_timestamp",
&self.completed_time,
"The timestamp this action was completed",
);
c.publish(
"current_state",
self.state.as_ref(),
"The current stage of the action.",
);
}
}
147 changes: 0 additions & 147 deletions nativelink-scheduler/src/scheduler_state/metrics.rs

This file was deleted.

1 change: 0 additions & 1 deletion nativelink-scheduler/src/scheduler_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ pub(crate) mod awaited_action;
pub(crate) mod client_action_state_result;
pub(crate) mod completed_action;
pub(crate) mod matching_engine_action_state_result;
pub(crate) mod metrics;
pub mod state_manager;
pub mod workers;

0 comments on commit 3070a40

Please sign in to comment.