[LNT] r318197 - Cleanup __health endpoint
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 13:12:19 PST 2017
Author: cmatthews
Date: Tue Nov 14 13:12:19 2017
New Revision: 318197
URL: http://llvm.org/viewvc/llvm-project?rev=318197&view=rev
Log:
Cleanup __health endpoint
This had some name shadowing. Also remove Asyn-ops reporting, I am
removing that in a moment.
Modified:
lnt/trunk/lnt/server/ui/views.py
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=318197&r1=318196&r2=318197&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Tue Nov 14 13:12:19 2017
@@ -1552,22 +1552,18 @@ def debug():
@frontend.route('/__health')
def health():
- """Our instnace health. If queue is too long or we use too much mem,
+ """Our instance health. If queue is too long or we use too much mem,
return 500. Monitor might reboot us for this."""
- explode = False
+ is_bad_state = False
msg = "Ok"
- queue_length = async_ops.check_workers(False)
- if queue_length > 10:
- explode = True
- msg = "Queue too long."
import resource
stats = resource.getrusage(resource.RUSAGE_SELF)
mem = stats.ru_maxrss
if mem > 1024**3:
- explode = True
+ is_bad_state = True
msg = "Over memory " + str(mem) + ">" + str(1024**3)
- if explode:
+ if is_bad_state:
return msg, 500
return msg, 200
More information about the llvm-commits
mailing list