Always create in pt-agent even if not --daemonize to avoid crash. Update test result with new histogram data.

This commit is contained in:
Daniel Nichter
2013-09-18 14:05:48 -07:00
parent bf6500bf36
commit 3ebd66b8e9
2 changed files with 26 additions and 16 deletions

View File

@@ -5891,26 +5891,24 @@ sub start_agent {
$logger->info('Starting agent');
# Daemonize first so all output goes to the --log.
my $daemon;
if ( $daemonize ) {
$daemon = Daemon->new(
daemonize => $daemonize,
pid_file => $pid_file,
log_file => $log_file,
parent_exit => sub {
my $child_pid = shift;
print "pt-agent has daemonized and is running as PID $child_pid:
my $daemon = Daemon->new(
daemonize => $daemonize,
pid_file => $pid_file,
log_file => $log_file,
parent_exit => sub {
my $child_pid = shift;
print "pt-agent has daemonized and is running as PID $child_pid:
--lib " . ($lib_dir || '') . "
--log " . ($log_file || '') . "
--pid " . ($pid_file || '') . "
--lib " . ($lib_dir || '') . "
--log " . ($log_file || '') . "
--pid " . ($pid_file || '') . "
These values can change if a different configuration is received.
",
}
);
$daemon->run();
}
);
$daemon->run();
if ( $daemonize ) {
# If we daemonized, the parent has already exited and we're the child.
# We shared a copy of every Cxn with the parent, and the parent's copies
# were destroyed but the dbhs were not disconnected because the parent

View File

@@ -10,6 +10,18 @@
"ts" : null
},
"fingerprint" : "select min(id),max(id) from tbl",
"histograms" : {
"Query_time" : [
0,
0,
0,
0,
1,
0,
0,
0
]
},
"metrics" : {
"Lock_time" : {
"avg" : "0.009453",