use of org.rocksdb.HistogramData in project kafka by apache.
the class RocksDBMetricsRecorderTest method shouldCorrectlyHandleHitRatioRecordingsWithZeroHitsAndMisses.
@Test
public void shouldCorrectlyHandleHitRatioRecordingsWithZeroHitsAndMisses() {
reset(statisticsToAdd1);
recorder.addValueProviders(SEGMENT_STORE_NAME_1, dbToAdd1, cacheToAdd1, statisticsToAdd1);
expect(statisticsToAdd1.getHistogramData(anyObject())).andStubReturn(new HistogramData(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0L, 0L, 0.0));
expect(statisticsToAdd1.getAndResetTickerCount(anyObject())).andStubReturn(0L);
replay(statisticsToAdd1);
memtableHitRatioSensor.record(0, 0L);
blockCacheDataHitRatioSensor.record(0, 0L);
blockCacheIndexHitRatioSensor.record(0, 0L);
blockCacheFilterHitRatioSensor.record(0, 0L);
replay(memtableHitRatioSensor);
replay(blockCacheDataHitRatioSensor);
replay(blockCacheIndexHitRatioSensor);
replay(blockCacheFilterHitRatioSensor);
recorder.record(0L);
verify(memtableHitRatioSensor);
verify(blockCacheDataHitRatioSensor);
verify(blockCacheIndexHitRatioSensor);
verify(blockCacheFilterHitRatioSensor);
}
Aggregations