eolivelli commented on a change in pull request #13380:
URL: https://github.com/apache/pulsar/pull/13380#discussion_r771309644
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsServlet.java
##########
@@ -70,18 +71,27 @@ protected void doGet(HttpServletRequest request,
HttpServletResponse response)
AsyncContext context = request.startAsync();
context.setTimeout(metricsServletTimeoutMs);
executor.execute(safeRun(() -> {
+ long start = System.currentTimeMillis();
HttpServletResponse res = (HttpServletResponse)
context.getResponse();
try {
res.setStatus(HttpStatus.OK_200);
res.setContentType("text/plain");
PrometheusMetricsGenerator.generate(pulsar,
shouldExportTopicMetrics, shouldExportConsumerMetrics,
shouldExportProducerMetrics,
splitTopicAndPartitionLabel, res.getOutputStream(),
metricsProviders);
- context.complete();
-
} catch (Exception e) {
- log.error("Failed to generate prometheus stats", e);
+ long end = System.currentTimeMillis();
+ long time = end - start;
Review comment:
I don't like very much Guava Stopwatch (in the past the broke
compatibility), and in general I believe that we should keep off Guava as much
as possible (still for the fact that they break the APIs quite often)
--
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]