massakam opened a new pull request #1567: Fix bug that WebSocket proxy returns 
empty metrics
   ### Motivation
   WebSocket proxy provides an endpoint for obtaining metrics.
   However, I realized that the endpoint almost always returns empty JSON `[]`.
   There are two causes for this.
   First, there is a possibility that NullPointerException occurs in this line:
   `publishMsgLatency` is not initialized unless at least one producer is 
   Seccond, `tempMetricsCollection` is not an local variable but an instance 
   As a result, the three variables `tempMetricsCollection`, `tempRef` and 
`metricsCollection` always refer to the same instance, and `metricsCollection` 
is cleared each time after the second and subsequent execution of `generate()`.
   ### Modifications
   * Initialize `publishMsgLatency` in the constructor of `ProxyNamespaceStats`
   * Declare `tempMetricsCollection` as local variable
   ### Result
   WebSocket proxy no longer returns empty metrics.

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to