Cache averageByte 0 and hitRate ~0.5

Hi guys,

Please take a look at these cache metrics from a broker with version 0.7.1.1:

2015-07-29_10:05:09.47955 2015-07-29T10:05:09,479 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.479Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/numEntries”,“value”:0}]
2015-07-29_10:05:09.47991 2015-07-29T10:05:09,479 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.479Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/sizeBytes”,“value”:0}]
2015-07-29_10:05:09.48025 2015-07-29T10:05:09,480 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.479Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/hits”,“value”:10784}]
2015-07-29_10:05:09.48054 2015-07-29T10:05:09,480 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.480Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/misses”,“value”:11520}]
2015-07-29_10:05:09.48088 2015-07-29T10:05:09,480 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.480Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/evictions”,“value”:0}]
2015-07-29_10:05:09.48152 2015-07-29T10:05:09,481 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.480Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/hitRate”,“value”:0.4835007173601148}]
2015-07-29_10:05:09.48187 2015-07-29T10:05:09,481 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.481Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/averageBytes”,“value”:0}]
2015-07-29_10:05:09.48231 2015-07-29T10:05:09,482 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.481Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/timeouts”,“value”:0}]
2015-07-29_10:05:09.48259 2015-07-29T10:05:09,482 INFO [MonitorScheduler-0] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“metrics”,“timestamp”:“2015-07-29T10:05:09.482Z”,“service”:“broker”,“host”:“i0008a4c9:8080”,“metric”:“cache/total/errors”,“value”:0}]

I’m using the following cache settings:

druid.cache.type=memcached
druid.cache.hosts=i0008a4c0:11211
druid.cache.expiration=2147483647
druid.cache.memcachedPrefix=druid
druid.broker.cache.useCache=true
druid.cache.sizeInBytes=1073741824

How is it possible that sizeBytes, numEntries and averageBytes equal zero but hits and hitRate are both greater than zero?

Thanks.

They are hardwired to 0 in the code at io.druid.client.cache.MemcachedCache#getStats

They probably shouldn’t emit those stats in such a case instead of setting them equal to zero.