beast icon indicating copy to clipboard operation
beast copied to clipboard

Implemented health check route

Open kartikgoyal137 opened this issue 3 months ago • 3 comments

/status/health/:name displays cpu_percentage, memory_percentage and memory_usage in bytes. Does simple challenge use any cpu? It came 0 percent. Added three functions in package cr containers.go, GetContainerStats, GetContainerLimits and RestartContainer beast health-probe also logs the memory usage.

kartikgoyal137 avatar Oct 07 '25 11:10 kartikgoyal137

Please remove all the irrelevant changes i.e version upgrades from the mod files. Also, did you manage to test this and get accurate usage statistics for the containers?

DarkPhoenix42 avatar Dec 11 '25 13:12 DarkPhoenix42

memory part is accurate and working fine, however the CPU still returns 0 even if I print the absolute amount instead of difference. I ran the healthprobe in a go routine as it was exiting and added resource limits to example challenges (otherwise there was an error while running). Should I keep these changes?

kartikgoyal137 avatar Dec 12 '25 13:12 kartikgoyal137

@DarkPhoenix42 reverted go.mod and go.sum files

kartikgoyal137 avatar Dec 14 '25 15:12 kartikgoyal137

Done. Put it as a separate route with adminauthorize middleware

kartikgoyal137 avatar Dec 23 '25 09:12 kartikgoyal137