mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-01-29 03:07:54 +08:00
Always create in pt-agent even if not --daemonize to avoid crash. Update test result with new histogram data.
This commit is contained in:
30
bin/pt-agent
30
bin/pt-agent
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user