worker: optionally publish influxdb stats

This commit is contained in:
Daniel Friesel 2022-12-30 16:27:51 +01:00
parent ccc93413a2
commit 59f844103d
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -249,6 +249,18 @@ sub run {
} }
)->wait; )->wait;
} }
my $started_at = $now;
$now = DateTime->now( time_zone => 'Europe/Berlin' );
my $worker_duration = $now->epoch - $started_at->epoch;
if ( $self->app->config->{influxdb}->{url} ) {
$self->app->ua->post_p(
$self->app->config->{influxdb}->{url},
"worker duration_seconds=$worker_duration"
)->wait;
}
} }
1; 1;