show debug info

v1.18.x
barisusakli 9 years ago
parent d621b120b0
commit 1364fb94bf

@ -20,14 +20,14 @@ cacheController.get = function(req, res, next) {
itemCount: postCache.itemCount, itemCount: postCache.itemCount,
percentFull: percentFull, percentFull: percentFull,
avgPostSize: avgPostSize, avgPostSize: avgPostSize,
dump: req.query.debug ? postCache.dump() : undefined dump: req.query.debug ? JSON.stringify(postCache.dump(), null, 4) : false
}, },
groupCache: { groupCache: {
length: groupCache.length, length: groupCache.length,
max: groupCache.max, max: groupCache.max,
itemCount: groupCache.itemCount, itemCount: groupCache.itemCount,
percentFull: ((groupCache.length / groupCache.max) * 100).toFixed(2), percentFull: ((groupCache.length / groupCache.max) * 100).toFixed(2),
dump: req.query.debug ? groupCache.dump() : undefined dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false
} }
}); });
}; };

@ -20,6 +20,10 @@
</div> </div>
</div> </div>
<!-- IF postCache.dump -->
<pre>{postCache.dump}</pre>
<!-- ENDIF postCache.dump -->
</div> </div>
</div> </div>
@ -39,6 +43,10 @@
</div> </div>
</div> </div>
<!-- IF groupCache.dump -->
<pre>{groupCache.dump}</pre>
<!-- ENDIF groupCache.dump -->
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save