|
|
@ -10,7 +10,7 @@ cacheController.get = async function (req, res) {
|
|
|
|
const groupCache = require('../../groups').cache;
|
|
|
|
const groupCache = require('../../groups').cache;
|
|
|
|
const { objectCache } = require('../../database');
|
|
|
|
const { objectCache } = require('../../database');
|
|
|
|
const localCache = require('../../cache');
|
|
|
|
const localCache = require('../../cache');
|
|
|
|
|
|
|
|
const uptimeInSeconds = process.uptime();
|
|
|
|
function getInfo(cache) {
|
|
|
|
function getInfo(cache) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
length: cache.length,
|
|
|
|
length: cache.length,
|
|
|
@ -21,6 +21,7 @@ cacheController.get = async function (req, res) {
|
|
|
|
((cache.length / cache.maxSize) * 100).toFixed(2) :
|
|
|
|
((cache.length / cache.maxSize) * 100).toFixed(2) :
|
|
|
|
((cache.itemCount / cache.max) * 100).toFixed(2),
|
|
|
|
((cache.itemCount / cache.max) * 100).toFixed(2),
|
|
|
|
hits: utils.addCommas(String(cache.hits)),
|
|
|
|
hits: utils.addCommas(String(cache.hits)),
|
|
|
|
|
|
|
|
hitsPerSecond: (cache.hits / uptimeInSeconds).toFixed(2),
|
|
|
|
misses: utils.addCommas(String(cache.misses)),
|
|
|
|
misses: utils.addCommas(String(cache.misses)),
|
|
|
|
hitRatio: ((cache.hits / (cache.hits + cache.misses) || 0)).toFixed(4),
|
|
|
|
hitRatio: ((cache.hits / (cache.hits + cache.misses) || 0)).toFixed(4),
|
|
|
|
enabled: cache.enabled,
|
|
|
|
enabled: cache.enabled,
|
|
|
|