Skip to content

Commit

Permalink
sort the language labels
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Dec 6, 2024
1 parent 1a79690 commit b3a5da8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion skystreamer-prometheus-exporter/src/posts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl PostsRegistry {

{
// Languages of the posts
let langs = post
let mut langs = post
.language
.iter()
.map(|lang| {
Expand All @@ -291,6 +291,9 @@ impl PostsRegistry {
})
.collect::<Vec<_>>();

// sort the languages
langs.sort();

langs.iter().for_each(|lang| {
self.language_counter_individual
.with_label_values(&[lang])
Expand Down

0 comments on commit b3a5da8

Please sign in to comment.