Counters

Counter support for HDHT.

Example format of aggregated counters.
{"name":"Store","tuplesProcessedPSMA":{"min":"35662","max":"35662","sum":"35662","avg":"35662"},"tuplesEmittedPSMA":{"min":"0","max":"0","sum":"0","avg":"0"},"cpuPercentageMA":{"min":"7.596069400496023","max":"7.596069400496023","sum":"7.596069400496023","avg":"7.596069400496023"},"latencyMA":{"min":"1","max":"1","sum":null,"avg":"1"},"lastHeartbeat":{"min":"1416929430546","max":"1416929430546","sum":null,"avg":null},"failureCount":{"min":null,"max":null,"sum":"0","avg":null},"recoveryWindowId":{"min":"6085664067941302931","max":"6085664067941302931","sum":null,"avg":null},"currentWindowId":{"min":"6085664067941302967","max":"6085664067941302967","sum":null,"avg":null},"counters":{"globalStats":{"walBytesWritten":"12731104000","walFlushCount":"23","walFlushTime":"36976","walKeysWritten":"12148000","dataFilesWritten":"26","dataBytesWritten":"2927846409","dataWriteTime":"102382","dataKeysWritten":"2368204","dataKeysRewritten":"913183","dataInWriteCache":"249843","dataInFrozenCache":"1333800","filesReadInCurrent":"0","filesWroteInCurrent":"0","dataFilesRead":"9","dataReadTime":"162113","dataBytesRead":"952871683"},"aggregatedStats":{"0":{"walBytesWritten":"12731104000","walFlushCount":"23","walFlushTime":"36976","walKeysWritten":"12148000","dataFilesWritten":"26","dataBytesWritten":"2927846409","dataWriteTime":"102382","dataKeysWritten":"2368204","dataKeysRewritten":"913183","dataInWriteCache":"249843","dataInFrozenCache":"1333800","filesReadInCurrent":"0","filesWroteInCurrent":"0","dataFilesRead":"9","dataReadTime":"162113","dataBytesRead":"952871683"}}}}

This looks wrong. WAL needs to be flushed in endWindow and the frequency of flushing controlled through application window,