File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ public function onPhpbuEnd(End $event)
102
102
$ this ->write ('# TYPE phpbu_backup_duration gauge ' . PHP_EOL );
103
103
foreach ($ this ->backupStats as $ backupName => $ backupStats ) {
104
104
$ duration = $ this ->backupStats [$ backupName ]['timeEnd ' ] - $ this ->backupStats [$ backupName ]['timeStart ' ];
105
+ if ($ duration < 0 ) {
106
+ $ duration = 0 ;
107
+ }
105
108
$ this ->write ('phpbu_backup_duration{name=" ' . $ backupName . '"} ' . $ duration . PHP_EOL );
106
109
}
107
110
@@ -124,7 +127,7 @@ public function onPhpbuEnd(End $event)
124
127
foreach ($ this ->backupStats as $ backupName => $ backupStats ) {
125
128
$ this ->write (
126
129
'phpbu_backup_size{name=" ' . $ backupName . '"} ' .
127
- $ this ->backupStats [$ backupName ]['size ' ] .
130
+ ( $ this ->backupStats [$ backupName ]['size ' ] ?? " 0 " ) .
128
131
PHP_EOL
129
132
);
130
133
}
You can’t perform that action at this time.
0 commit comments