yifan-c commented on code in PR #64:
URL: https://github.com/apache/cassandra-sidecar/pull/64#discussion_r1303335182


##########
src/main/java/org/apache/cassandra/sidecar/utils/FileStreamer.java:
##########
@@ -123,6 +128,8 @@ private void acquireAndSend(HttpResponse response,
                                {
                                    LOGGER.debug("Streamed file {} successfully 
to client {}. Instance: {}", filename,
                                                 response.remoteAddress(), 
response.host());
+                                   
metricRegistry.register(MetricRegistry.name(FileStreamer.class, 
"bytes_streamed"),
+                                                     (Gauge<Long>) () -> 
fileLength);

Review Comment:
   It does not work as expected. 
   The code here tries to register the Gauge metric whenever a file streams 
successfully and only the first attempt succeeds. It then, only publishes the 
`fileLength` of that file and once. 
   
   It should not use `Gauge` type. Instead, it should be `Histograms` to not 
loose any update. 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to