elsloo commented on a change in pull request #8395:
URL: https://github.com/apache/trafficserver/pull/8395#discussion_r735961271
##########
File path: plugins/experimental/rate_limit/limiter.h
##########
@@ -139,6 +172,50 @@ template <class T> class RateLimiter
}
}
+ void
+ initializeMetrics(uint type)
+ {
+ TSReleaseAssert(type < RATE_LIMITER_TYPE_MAX);
+ memset(_metrics, 0, sizeof(_metrics));
+
+ std::string metric_prefix = prefix;
+ metric_prefix.append("." + std::string(types[type]));
+
+ if (!tag.empty()) {
+ metric_prefix.append("." + tag);
+ } else if (!description.empty()) {
+ metric_prefix.append("." + description);
+ }
+
+ for (int i = 0; i < RATE_LIMITER_METRIC_MAX; i++) {
+ size_t metricsz = metric_prefix.length() + strlen(types[type]) +
description.length() + 16; // padding for suffixes+dots
+ char *metric = (char *)TSmalloc(metricsz);
Review comment:
I just pushed a commit to address this issue.
--
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]