We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2945400 commit e8410bbCopy full SHA for e8410bb
src/Log/Prometheus.php
@@ -101,7 +101,10 @@ public function onPhpbuEnd(End $event)
101
$this->write('# HELP phpbu_backup_duration The total time the backup took to execute' . PHP_EOL);
102
$this->write('# TYPE phpbu_backup_duration gauge' . PHP_EOL);
103
foreach ($this->backupStats as $backupName => $backupStats) {
104
- $duration = abs($this->backupStats[$backupName]['timeEnd'] - $this->backupStats[$backupName]['timeStart']);
+ $duration = $this->backupStats[$backupName]['timeEnd'] - $this->backupStats[$backupName]['timeStart'];
105
+ if ($duration < 0) {
106
+ $duration = 0;
107
+ }
108
$this->write('phpbu_backup_duration{name="' . $backupName . '"} ' . $duration . PHP_EOL);
109
}
110
0 commit comments