worker: optionally publish influxdb stats
This commit is contained in:
parent
ccc93413a2
commit
59f844103d
1 changed files with 12 additions and 0 deletions
|
@ -249,6 +249,18 @@ sub run {
|
|||
}
|
||||
)->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;
|
||||
|
|
Loading…
Reference in a new issue