Skip to content

Commit

Permalink
remove solana-sdk from solana-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Nov 14, 2024
1 parent 8bf688f commit 23509b4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

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

4 changes: 3 additions & 1 deletion metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ gethostname = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
reqwest = { workspace = true, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] }
solana-sdk = { workspace = true }
solana-cluster-type = { workspace = true }
solana-sha256-hasher = { workspace = true }
solana-time-utils = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
Expand Down
3 changes: 1 addition & 2 deletions metrics/src/counter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use {
crate::metrics::submit_counter,
log::*,
solana_sdk::timing,
std::{
env,
sync::atomic::{AtomicU64, AtomicUsize, Ordering},
Expand Down Expand Up @@ -174,7 +173,7 @@ impl Counter {
.compare_and_swap(0, Self::default_metrics_rate(), Ordering::Relaxed);
}
pub fn inc(&mut self, level: log::Level, events: usize) {
let now = timing::timestamp();
let now = solana_time_utils::timestamp();
let counts = self.counts.fetch_add(events, Ordering::Relaxed);
let times = self.times.fetch_add(1, Ordering::Relaxed);
let lograte = self.lograte.load(Ordering::Relaxed);
Expand Down
3 changes: 2 additions & 1 deletion metrics/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use {
gethostname::gethostname,
lazy_static::lazy_static,
log::*,
solana_sdk::{genesis_config::ClusterType, hash::hash},
solana_cluster_type::ClusterType,
solana_sha256_hasher::hash,
std::{
cmp,
collections::HashMap,
Expand Down
17 changes: 8 additions & 9 deletions metrics/src/poh_timing_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use {
crossbeam_channel::{Receiver, Sender},
log::*,
solana_sdk::clock::Slot,
std::fmt,
};

Expand Down Expand Up @@ -36,9 +35,9 @@ impl fmt::Display for PohTimingPoint {
#[derive(Clone, Debug)]
pub struct SlotPohTimingInfo {
/// current slot
pub slot: Slot,
pub slot: u64,
/// root slot
pub root_slot: Option<Slot>,
pub root_slot: Option<u64>,
/// timing event
pub timing_point: PohTimingPoint,
}
Expand All @@ -58,8 +57,8 @@ impl fmt::Display for SlotPohTimingInfo {
impl SlotPohTimingInfo {
/// create slot start poh timing point
pub fn new_slot_start_poh_time_point(
slot: Slot,
root_slot: Option<Slot>,
slot: u64,
root_slot: Option<u64>,
timestamp: u64,
) -> SlotPohTimingInfo {
SlotPohTimingInfo {
Expand All @@ -71,8 +70,8 @@ impl SlotPohTimingInfo {

/// create slot end poh timing point
pub fn new_slot_end_poh_time_point(
slot: Slot,
root_slot: Option<Slot>,
slot: u64,
root_slot: Option<u64>,
timestamp: u64,
) -> SlotPohTimingInfo {
SlotPohTimingInfo {
Expand All @@ -84,8 +83,8 @@ impl SlotPohTimingInfo {

/// create slot full poh timing point
pub fn new_slot_full_poh_time_point(
slot: Slot,
root_slot: Option<Slot>,
slot: u64,
root_slot: Option<u64>,
timestamp: u64,
) -> SlotPohTimingInfo {
SlotPohTimingInfo {
Expand Down
4 changes: 3 additions & 1 deletion programs/sbf/Cargo.lock

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

0 comments on commit 23509b4

Please sign in to comment.