diff --git a/src/snek/view/stats.py b/src/snek/view/stats.py new file mode 100644 index 0000000..73714ce --- /dev/null +++ b/src/snek/view/stats.py @@ -0,0 +1,10 @@ +from snek.system.view import BaseView +import json +from aiohttp import web + +class StatsView(BaseView): + + async def get(self): + data = await self.app.cache.get_stats() + data = json.dumps({"total": len(data), "stats": data}, default=str, indent=1) + return web.Response(text=data, content_type='application/json')