Search in sources :

Example 6 with HistogramData

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);
}
Also used : HistogramData(org.rocksdb.HistogramData) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

HistogramData (org.rocksdb.HistogramData)6 Test (org.junit.Test)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 HistogramType (org.rocksdb.HistogramType)2 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 AttributeNotFoundException (javax.management.AttributeNotFoundException)1 InvalidAttributeValueException (javax.management.InvalidAttributeValueException)1 MBeanException (javax.management.MBeanException)1 ReflectionException (javax.management.ReflectionException)1 BlockBasedTableConfig (org.rocksdb.BlockBasedTableConfig)1 BloomFilter (org.rocksdb.BloomFilter)1 Filter (org.rocksdb.Filter)1 HashLinkedListMemTableConfig (org.rocksdb.HashLinkedListMemTableConfig)1 HashSkipListMemTableConfig (org.rocksdb.HashSkipListMemTableConfig)1 LRUCache (org.rocksdb.LRUCache)1 Options (org.rocksdb.Options)1 PlainTableConfig (org.rocksdb.PlainTableConfig)1 RateLimiter (org.rocksdb.RateLimiter)1 ReadOptions (org.rocksdb.ReadOptions)1