### Question:
PrometheusMetricsSink implements MetricsSink { public String prometheusName(String recordName, String metricName) { if (StringUtils.isNotEmpty(recordName) && recordName.startsWith(ROCKSDB_CONTEXT_PREFIX)) { return normalizeName(recordName) + "_" + metricName.toLowerCase(); } String baseName = StringUtils.capitalize(recordName) + StringUtils.capitalize(metricName); return normalizeName(baseName); } PrometheusMetricsSink(); @Override void putMetrics(MetricsRecord metricsRecord); String prometheusName(String recordName,
      String metricName); static String normalizeName(String baseName); @Override void flush(); @Override void init(SubsetConfiguration subsetConfiguration); void writeMetrics(Writer writer);  }### Answer:
@Test public void testNamingCamelCase() { PrometheusMetricsSink sink = new PrometheusMetricsSink(); Assert.assertEquals("rpc_time_some_metrics", sink.prometheusName("RpcTime", "SomeMetrics")); Assert.assertEquals("om_rpc_time_om_info_keys", sink.prometheusName("OMRpcTime", "OMInfoKeys")); Assert.assertEquals("rpc_time_small", sink.prometheusName("RpcTime", "small")); }
@Test public void testNamingRocksDB() { PrometheusMetricsSink sink = new PrometheusMetricsSink(); Assert.assertEquals("rocksdb_om_db_num_open_connections", sink.prometheusName("Rocksdb_om.db", "num_open_connections")); }
@Test public void testNamingPipeline() { PrometheusMetricsSink sink = new PrometheusMetricsSink(); String recordName = "SCMPipelineMetrics"; String metricName = "NumBlocksAllocated-" + "RATIS-THREE-47659e3d-40c9-43b3-9792-4982fc279aba"; Assert.assertEquals( "scm_pipeline_metrics_" + "num_blocks_allocated_" + "ratis_three_47659e3d_40c9_43b3_9792_4982fc279aba", sink.prometheusName(recordName, metricName)); }
@Test public void testNamingSpaces() { PrometheusMetricsSink sink = new PrometheusMetricsSink(); String recordName = "JvmMetrics"; String metricName = "GcTimeMillisG1 Young Generation"; Assert.assertEquals( "jvm_metrics_gc_time_millis_g1_young_generation", sink.prometheusName(recordName, metricName)); }