cameronlee314 commented on a change in pull request #1158: SAMZA-2324: Adding 
KV store metrics for rocksdb
URL: https://github.com/apache/samza/pull/1158#discussion_r325393060
 
 

 ##########
 File path: 
samza-kv/src/main/scala/org/apache/samza/storage/kv/SerializedKeyValueStore.scala
 ##########
 @@ -55,23 +55,27 @@ class SerializedKeyValueStore[K, V](
   }
 
   def put(key: K, value: V) {
-    metrics.puts.inc
     val keyBytes = toBytesOrNull(key, keySerde)
     val valBytes = toBytesOrNull(value, msgSerde)
     store.put(keyBytes, valBytes)
+    metrics.puts.inc
+    
metrics.maxRecordSizeBytes.set(Math.max(metrics.maxRecordSizeBytes.getValue, 
valBytes.length))
 
 Review comment:
   From a metrics perspective, I agree that we don't need exactness (since this 
is open source, we shouldn't be referring to specific metrics display techs 
though). I think it is reasonable to document the known exactness issue and 
then go with this logic, as long as it won't get into a really bad state (e.g. 
access of incomplete object, significantly incorrect value).
   However, do be wary that there is at least one place in Samza in which 
metrics is used for functionality (see "needed-containers" access in 
`ClientHelper.scala`; it probably shouldn't be used for functionality though).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to