Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function metrics(Response $response): void |
||
24 | { |
||
25 | $stats = $this->searcher->stats(); |
||
26 | |||
27 | $body = "# HELP xhgui_profiles_total Number of profiles collected.\n"; |
||
28 | $body .= "# TYPE xhgui_profiles_total gauge\n"; |
||
29 | $body .= sprintf("xhgui_profiles_total %0.1F\n\n", $stats['profiles']); |
||
30 | |||
31 | $body .= "# HELP xhgui_profile_bytes_total Size of profiles collected.\n"; |
||
32 | $body .= "# TYPE xhgui_profile_bytes_total gauge\n"; |
||
33 | $body .= sprintf("xhgui_profile_bytes_total %0.1F\n\n", $stats['bytes']); |
||
34 | |||
35 | $body .= "# HELP xhgui_latest_profile_seconds UNIX timestamp of most recent profile.\n"; |
||
36 | $body .= "# TYPE xhgui_latest_profile_seconds gauge\n"; |
||
37 | $body .= sprintf("xhgui_latest_profile_seconds %0.1F\n", $stats['latest']); |
||
38 | |||
39 | $response->body($body); |
||
40 | $response['Content-Type'] = 'text/plain; version=0.0.4'; |
||
41 | } |
||
42 | } |
||
43 |