ommit timestamp for now
parent
8d8260898f
commit
7db2046042
|
@ -238,8 +238,8 @@ function output(): void
|
||||||
$labels .
|
$labels .
|
||||||
" " .
|
" " .
|
||||||
$entry["value"] .
|
$entry["value"] .
|
||||||
#" " .
|
" " .
|
||||||
#$entry["timestamp"] .
|
$entry["timestamp"] .
|
||||||
"\n";
|
"\n";
|
||||||
}
|
}
|
||||||
file_put_contents("/www/metrics/new.prom", $prom);
|
file_put_contents("/www/metrics/new.prom", $prom);
|
||||||
|
@ -251,7 +251,7 @@ function filter(): void
|
||||||
{
|
{
|
||||||
global $data, $stats;
|
global $data, $stats;
|
||||||
$data = array_filter($data, function ($entry) {
|
$data = array_filter($data, function ($entry) {
|
||||||
return $entry["timestamp"] > time() - 5 * 60; // 5 min is the hardcoded value in prometheus
|
return $entry["timestamp"] > time() - 60;
|
||||||
});
|
});
|
||||||
// remove stats older than 24h
|
// remove stats older than 24h
|
||||||
foreach ($stats as $key => $values) {
|
foreach ($stats as $key => $values) {
|
||||||
|
|
Loading…
Reference in New Issue