File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1135,18 +1135,16 @@ impl Endpoint {
11351135 /// For example, the following snippet collects all metrics into a map:
11361136 /// ```rust
11371137 /// # use std::collections::BTreeMap;
1138- /// # use iroh_metrics::{MetricsGroup, MetricValue, MetricsGroupSet};
1138+ /// # use iroh_metrics::{Metric, MetricsGroup, MetricValue, MetricsGroupSet};
11391139 /// # use iroh::endpoint::Endpoint;
11401140 /// # async fn wrapper() -> testresult::TestResult {
11411141 /// let endpoint = Endpoint::builder().bind().await?;
11421142 /// let metrics: BTreeMap<String, MetricValue> = endpoint
11431143 /// .metrics()
11441144 /// .iter()
1145- /// .flat_map(|group| {
1146- /// group.values().map(|item| {
1147- /// let name = [group.name(), item.name].join(":");
1148- /// (name, item.value)
1149- /// })
1145+ /// .map(|(group, metric)| {
1146+ /// let name = [group, metric.name()].join(":");
1147+ /// (name, metric.value())
11501148 /// })
11511149 /// .collect();
11521150 ///
You can’t perform that action at this time.
0 commit comments