Skip to content

Commit

Permalink
[AGENT] Fix duplicated flow map allocator stats counter
Browse files Browse the repository at this point in the history
  • Loading branch information
rvql authored and sharang committed Oct 18, 2023
1 parent c731397 commit 413c4fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions agent/src/flow_generator/flow_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ impl FlowMap {
stats_collector.register_countable(
"allocator",
Countable::Ref(allocator.counter()),
vec![StatsOption::Tag("type", "TaggedFlow".to_owned())],
vec![
StatsOption::Tag("type", "TaggedFlow".to_owned()),
StatsOption::Tag("id", format!("{}", id)),
],
);
allocator
},
Expand All @@ -300,7 +303,10 @@ impl FlowMap {
stats_collector.register_countable(
"allocator",
Countable::Ref(allocator.counter()),
vec![StatsOption::Tag("type", "L7Stats".to_owned())],
vec![
StatsOption::Tag("type", "L7Stats".to_owned()),
StatsOption::Tag("id", format!("{}", id)),
],
);
allocator
},
Expand Down
2 changes: 1 addition & 1 deletion agent/src/utils/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Collector {
let equals = s == &source;
if !closed && equals {
warn!(
"Possible memory leak! countable {} is not correctly closed.",
"Found duplicated counter source {}, please check if the old one is correctly closed.",
source
);
}
Expand Down

0 comments on commit 413c4fe

Please sign in to comment.