work, traewelling: only push to influxdb in prod mode
This commit is contained in:
parent
5c9adc4710
commit
628bd319d6
2 changed files with 20 additions and 5 deletions
|
@ -126,8 +126,15 @@ sub run {
|
||||||
if ( not $direction or $direction eq 'pull' ) {
|
if ( not $direction or $direction eq 'pull' ) {
|
||||||
$report .= ",pull_runtime_seconds=${trwl_pull_duration}";
|
$report .= ",pull_runtime_seconds=${trwl_pull_duration}";
|
||||||
}
|
}
|
||||||
$self->app->ua->post_p( $self->app->config->{influxdb}->{url},
|
if ( $self->app->mode eq 'development' ) {
|
||||||
"traewelling ${report}" )->wait;
|
$self->app->log->debug( 'POST '
|
||||||
|
. $self->app->config->{influxdb}->{url}
|
||||||
|
. " traewelling ${report}" );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$self->app->ua->post_p( $self->app->config->{influxdb}->{url},
|
||||||
|
"traewelling ${report}" )->wait;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,9 +184,17 @@ sub run {
|
||||||
my $worker_duration = $main_finished_at->epoch - $started_at->epoch;
|
my $worker_duration = $main_finished_at->epoch - $started_at->epoch;
|
||||||
|
|
||||||
if ( $self->app->config->{influxdb}->{url} ) {
|
if ( $self->app->config->{influxdb}->{url} ) {
|
||||||
$self->app->ua->post_p( $self->app->config->{influxdb}->{url},
|
if ( $self->app->mode eq 'development' ) {
|
||||||
"worker runtime_seconds=${worker_duration},errors=${errors}" )
|
$self->app->log->debug( 'POST '
|
||||||
->wait;
|
. $self->app->config->{influxdb}->{url}
|
||||||
|
. " worker runtime_seconds=${worker_duration},errors=${errors}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$self->app->ua->post_p( $self->app->config->{influxdb}->{url},
|
||||||
|
"worker runtime_seconds=${worker_duration},errors=${errors}" )
|
||||||
|
->wait;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( not $self->app->config->{traewelling}->{separate_worker} ) {
|
if ( not $self->app->config->{traewelling}->{separate_worker} ) {
|
||||||
|
|
Loading…
Reference in a new issue