getServiceState: configurable threshold

for testing
This commit is contained in:
Skip R. 2018-07-22 12:26:06 -07:00
parent ec52c980fb
commit a1cca92a8c
No known key found for this signature in database
GPG key ID: 1508C19D7436A26D

View file

@ -24,8 +24,8 @@ const titles = {
dead: 'This service is unresponsive.',
}
function getServiceState (status, latency) {
if (status && latency > SLOW_THRESHOLD) {
export function getServiceState (status, latency, threshold = SLOW_THRESHOLD) {
if (status && latency > threshold) {
return 'slow'
}