------------------------------------------------------------ revno: 13348 revision-id: kinkie@squid-cache.org-20140410080255-cn0q2mjkb9c80o19 parent: squid3@treenet.co.nz-20140409022452-evip0jz0jz457tsi committer: Francesco Chemolli branch nick: trunk timestamp: Thu 2014-04-10 10:02:55 +0200 message: Implement custom formatting for SBuf size distribution cachemgr report ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kinkie@squid-cache.org-20140410080255-cn0q2mjkb9c80o19 # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: d19b69937a00f29d355cdb7688cab10c43836df6 # timestamp: 2014-04-10 08:54:06 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140409022452-\ # evip0jz0jz457tsi # # Begin patch === modified file 'src/SBufStatsAction.cc' --- src/SBufStatsAction.cc 2014-02-08 13:36:42 +0000 +++ src/SBufStatsAction.cc 2014-04-10 08:02:55 +0000 @@ -62,6 +62,14 @@ mbsizesatdestruct = *collectMemBlobDestructTimeStats(); } +static void +statHistSBufDumper(StoreEntry * sentry, int idx, double val, double size, int count) +{ + if (count == 0) + return; + storeAppendPrintf(sentry, "\t%d-%d\t%d\n", static_cast(val), static_cast(val+size), count); +} + void SBufStatsAction::dump(StoreEntry* entry) { @@ -73,9 +81,9 @@ mbdata.dump(ses); ses << "\n"; ses << "SBuf size distribution at destruct time:\n"; - sbsizesatdestruct.dump(entry,NULL); + sbsizesatdestruct.dump(entry,statHistSBufDumper); ses << "MemBlob size distribution at destruct time:\n"; - mbsizesatdestruct.dump(entry,NULL); + mbsizesatdestruct.dump(entry,statHistSBufDumper); } void