From 317b7d538b4ff23619f7df68d4aef19ca5b63e40 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Sun, 9 Jun 2013 20:03:15 -0700 Subject: [PATCH] Set logger service and data_ts. --- bin/pt-agent | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/pt-agent b/bin/pt-agent index 3a278bab..2fab98d9 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -6759,6 +6759,8 @@ sub run_service { my $log_link = $agent->links->{log}; $logger->info("Starting online logging. No more log entries will be printed here. " . "Agent logs are accessible through the web interface."); + $logger->service($service); + $logger->data_ts($prefix); $logger->start_online_logging( client => $logger_client, log_link => $log_link, @@ -7179,6 +7181,7 @@ sub send_data { my $log_link = $agent->links->{log}; $logger->info("Starting online logging. No more log entries will be printed here. " . "Agent logs are accessible through the web interface."); + $logger->service($service); $logger->start_online_logging( client => $logger_client, log_link => $log_link, @@ -7204,7 +7207,10 @@ sub send_data { DATA_FILE: foreach my $data_file ( glob "$service_dir/*.data" ) { (my $meta_file = $data_file) =~ s/\.data/.meta/; - + my ($data_ts) = $data_file =~ m/\/(\d+)\.\w+/; + if ( $data_ts ) { + $logger->data_ts($data_ts); + } eval { # Send the file as-is. The --run-service process should # have written the data in a format that's ready to send.