Skip to content

Commit

Permalink
reset tags and labels
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Dec 6, 2024
1 parent 813daf5 commit ac38029
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions skystreamer-prometheus-exporter/src/posts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ impl PostsRegistry {
tag_entry.1 += 1;
tag_entry.0 = tokio::time::Instant::now();

self.tags_counter.reset();

self.tags
.retain(|_, (time, _)| time.elapsed() < tokio::time::Duration::from_secs(1800));

Expand Down Expand Up @@ -88,6 +90,8 @@ impl PostsRegistry {
label_entry.1 += 1;
label_entry.0 = tokio::time::Instant::now();

self.label_counter.reset();

self.labels
.retain(|_, (time, _)| time.elapsed() < tokio::time::Duration::from_secs(1800));

Expand Down

0 comments on commit ac38029

Please sign in to comment.