diff --git a/index.php b/index.php index f8d8a04..4c3944e 100644 --- a/index.php +++ b/index.php @@ -44,6 +44,8 @@ if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') { if (isset($submetric['http']['data']) && $submetric['http']['data'] == 'responsebody') { $output = $res->getBody()->getContents(); + } elseif ((isset($submetric['http']['statuscode'])) && (isset($submetric['http']['data']) && $submetric['http']['data'] == 'hasresponse')) { + $output = (int)in_array($res->getStatusCode(), $submetric['http']['statuscode']); } elseif (isset($submetric['http']['data']) && $submetric['http']['data'] == 'hasresponse') { $output = (int)$hasresponse; }