cmcfarlen commented on code in PR #13506:
URL: https://github.com/apache/trafficserver/pull/13506#discussion_r3853504531
##########
src/tsutil/Metrics.cc:
##########
@@ -257,6 +295,26 @@ namespace details
metrics.push_back(std::move(m));
}
+ void
+ add_source(Metrics::IdType id, Metrics::AtomicType *source,
Metrics::Derived::Op op)
+ {
+ if (!source) {
+ return;
+ }
+
+ std::lock_guard l(metrics_lock);
+ auto it = std::find_if(metrics.begin(), metrics.end(),
[id](DerivedMetric const &m) { return m.metric == id; });
Review Comment:
Did some analysis with Claude it with small numbers of sources (dozens) the
overhead is tiny.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]