rmatharu commented on a change in pull request #1301: New kv metric
URL: https://github.com/apache/samza/pull/1301#discussion_r387908124
##########
File path:
samza-test/src/test/java/org/apache/samza/storage/kv/TestKeyValueSizeHistogramMetric.java
##########
@@ -0,0 +1,107 @@
+package org.apache.samza.storage.kv;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import org.apache.samza.SamzaException;
+import org.apache.samza.metrics.Gauge;
+import org.apache.samza.metrics.MetricsRegistry;
+import org.apache.samza.metrics.MetricsRegistryMap;
+import org.apache.samza.metrics.SamzaHistogram;
+import org.apache.samza.serializers.Serde;
+import org.apache.samza.serializers.StringSerde;
+import org.apache.samza.storage.kv.inmemory.InMemoryKeyValueStore;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class TestKeyValueSizeHistogramMetric {
+
+ private static String storeName = "testStore";
+ private static MetricsRegistry metricsRegistry = new MetricsRegistryMap();
+ private static KeyValueStoreMetrics keyValueStoreMetrics = new
KeyValueStoreMetrics(storeName, metricsRegistry);
+ private static SerializedKeyValueStoreMetrics serializedKeyValueStoreMetrics
=
+ new SerializedKeyValueStoreMetrics(storeName, metricsRegistry);
+ private static Serde<String> stringSerde = new StringSerde();
+ private static Random random = new Random();
+
+ private KeyValueStore<String, String> store = null;
+
+ @Before
+ public void setup() {
+ KeyValueStore<byte[], byte[]> kvStore = new
InMemoryKeyValueStore(keyValueStoreMetrics);
+ KeyValueStore<String, String> serializedStore =
+ new SerializedKeyValueStore<>(kvStore, stringSerde, stringSerde,
serializedKeyValueStoreMetrics);
+ store = new NullSafeKeyValueStore<>(serializedStore);
+ }
+
+ @Test
+ public void testHistogramMetric() {
Review comment:
Maybe add comments to describe what this test is doing?
----------------------------------------------------------------
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