bkonold 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_r325389437
##########
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:
You are correct. To avoid this I think we'd need to do a compareAndSet so
each thread would only update if they actually are the new max value at the
time the write happens.
InGraphs ends up diluting the granularity at most graph views anyway, so imo
I wouldn't consider exactness important here. The intention here is more to
track trend lines, than specific data points.
However, it may be useful to document the compromise we're making here if we
don't decide to change this.
----------------------------------------------------------------
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