Skip to content

Commit

Permalink
respect counters layout from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bragov4ik committed Dec 5, 2024
1 parent 35b9d54 commit f769c84
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stats/stats-server/src/read_service.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{clone::Clone, cmp::Ord, collections::BTreeMap, fmt::Debug, str::FromStr, sync::Arc};

use crate::{
config::types,
config::{layout::sorted_items_according_to_layout, types},
runtime_setup::{EnabledChartEntry, RuntimeSetup},
serializers::serialize_line_points,
settings::LimitsSettings,
Expand Down Expand Up @@ -225,7 +225,15 @@ impl StatsService for ReadService {
})
})
.collect();
let counters = proto_v1::Counters { counters };
let counters_sorted = sorted_items_according_to_layout(
counters,
&self.charts.counters_layout,
|c| &c.id,
true,
);
let counters = proto_v1::Counters {
counters: counters_sorted,
};
Ok(Response::new(counters))
}

Expand Down

0 comments on commit f769c84

Please sign in to comment.