Skip to content

Commit

Permalink
Disable solana-metrics for wasm target
Browse files Browse the repository at this point in the history
  • Loading branch information
dougEfresh committed Dec 27, 2024
1 parent c7131f6 commit b1d5fa9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion program-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ solana-instruction = { workspace = true }
solana-last-restart-slot = { workspace = true }
solana-log-collector = { workspace = true }
solana-measure = { workspace = true }
solana-metrics = { workspace = true }
solana-precompiles = { workspace = true }
solana-pubkey = { workspace = true }
solana-rent = { workspace = true }
Expand All @@ -52,6 +51,9 @@ solana-transaction-context = { workspace = true }
solana-type-overrides = { workspace = true }
thiserror = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
solana-metrics = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
solana-instruction = { workspace = true, features = ["bincode"] }
Expand Down
1 change: 1 addition & 0 deletions program-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![deny(clippy::arithmetic_side_effects)]
#![deny(clippy::indexing_slicing)]

#[cfg(not(target_family = "wasm"))]
#[macro_use]
extern crate solana_metrics;

Expand Down
2 changes: 2 additions & 0 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ impl LoadProgramMetrics {
timings.create_executor_load_elf_us += self.load_elf_us;
timings.create_executor_verify_code_us += self.verify_code_us;
timings.create_executor_jit_compile_us += self.jit_compile_us;

#[cfg(not(target_family = "wasm"))]
datapoint_trace!(
"create_executor_trace",
("program_id", self.program_id, String),
Expand Down

0 comments on commit b1d5fa9

Please sign in to comment.