Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/hyperlight_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ page_size = "0.6.0"
examples_common = { path = "../examples_common" }
criterion = { version = "0.5.1", features = ["html_reports"] }
lazy_static = "1.4.0"
prometheus = "0.13.3"
prometheus = "0.14.0"
crossbeam-queue = "0.3"
blake3 = "1.8"
toml = "0.8.19"
Expand Down
28 changes: 14 additions & 14 deletions src/hyperlight_wasm/examples/metrics/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,38 +141,38 @@ fn get_metrics() {
for metric in metrics.iter() {
match metric.get_field_type() {
prometheus::proto::MetricType::COUNTER => {
println!("Counter: {:?}", metric.get_help());
println!("Counter: {:?}", metric.help());
metric.get_metric().iter().for_each(|metric| {
let pair = metric.get_label();
for pair in pair.iter() {
println!("Label: {:?} Name: {:?}", pair.get_name(), pair.get_value());
println!("Label: {:?} Name: {:?}", pair.name(), pair.value());
}
println!("Value: {:?}", metric.get_counter().get_value());
println!("Value: {:?}", metric.get_counter().value());
});
}
prometheus::proto::MetricType::GAUGE => {
println!("Gauge: {:?}", metric.get_help());
println!("Gauge: {:?}", metric.help());
metric.get_metric().iter().for_each(|metric| {
let pair = metric.get_label();
for pair in pair.iter() {
println!("Label: {:?} Name: {:?}", pair.get_name(), pair.get_value());
println!("Label: {:?} Name: {:?}", pair.name(), pair.value());
}
println!("Value: {:?}", metric.get_gauge().get_value());
println!("Value: {:?}", metric.get_gauge().value());
});
}
prometheus::proto::MetricType::UNTYPED => {
println!("Metric: {:?}", metric.get_help());
println!("Metric: {:?}", metric.help());
}
prometheus::proto::MetricType::HISTOGRAM => {
println!("Histogram: {:?}", metric.get_help());
println!("Histogram: {:?}", metric.help());
for metric in metric.get_metric() {
let pair = metric.get_label();
for pair in pair.iter() {
println!("Label: {:?} Name: {:?}", pair.get_name(), pair.get_value());
println!("Label: {:?} Name: {:?}", pair.name(), pair.value());
}
let count = metric.get_histogram().get_sample_count();
let count = metric.get_histogram().sample_count();
println!("Number of observations: {:?}", count);
let sm = metric.get_histogram().get_sample_sum();
let sm = metric.get_histogram().sample_sum();
println!("Sum of observations: {:?}", sm);
metric
.get_histogram()
Expand All @@ -181,14 +181,14 @@ fn get_metrics() {
.for_each(|bucket| {
println!(
"Bucket: {:?} Count: {:?}",
bucket.get_upper_bound(),
bucket.get_cumulative_count()
bucket.upper_bound(),
bucket.cumulative_count()
)
});
}
}
prometheus::proto::MetricType::SUMMARY => {
println!("Summary: {:?}", metric.get_help());
println!("Summary: {:?}", metric.help());
}
}
}
Expand Down
Loading