Fix/update t/pt-agent/run_agent.t.

This commit is contained in:
Daniel Nichter
2013-03-19 14:56:53 -06:00
parent 70c28272a7
commit 9afa462cc2
3 changed files with 10 additions and 9 deletions

View File

@@ -4892,7 +4892,7 @@ sub make_new_crontab {
my @other_lines my @other_lines
= grep { $_ !~ m/pt-agent (?:--run-service|--send-data)/ } = grep { $_ !~ m/pt-agent (?:--run-service|--send-data)/ }
split("\n", $crontab_list); split("\n", $crontab_list);
PTDEBUG && _d('Other crontab lines:', \@other_lines); PTDEBUG && _d('Other crontab lines:', Dumper(\@other_lines));
my @pt_agent_lines; my @pt_agent_lines;
foreach my $service ( @$services ) { foreach my $service ( @$services ) {
@@ -4907,7 +4907,7 @@ sub make_new_crontab {
. $service->name; . $service->name;
} }
} }
PTDEBUG && _d('pt-agent crontab lines:', \@pt_agent_lines); PTDEBUG && _d('pt-agent crontab lines:', Dumper(\@pt_agent_lines));
my $new_crontab = join("\n", @other_lines, @pt_agent_lines) . "\n"; my $new_crontab = join("\n", @other_lines, @pt_agent_lines) . "\n";

View File

@@ -234,21 +234,21 @@ $ua->{responses}->{get} = [
# 2nd check, init with latest Config and Services # 2nd check, init with latest Config and Services
{ {
headers => { 'X-Percona-Resource-Type' => 'Config' }, headers => { 'X-Percona-Resource-Type' => 'Config' },
content => as_hashref($config), content => as_hashref($config, with_links => 1),
}, },
{ {
headers => { 'X-Percona-Resource-Type' => 'Service' }, headers => { 'X-Percona-Resource-Type' => 'Service' },
content => [ as_hashref($svc0) ], content => [ as_hashref($svc0, with_links => 1) ],
}, },
# interval # interval
# 3rd check, same Config and Services so nothing to do # 3rd check, same Config and Services so nothing to do
{ {
headers => { 'X-Percona-Resource-Type' => 'Config' }, headers => { 'X-Percona-Resource-Type' => 'Config' },
content => as_hashref($config), content => as_hashref($config, with_links => 1),
}, },
{ {
headers => { 'X-Percona-Resource-Type' => 'Service' }, headers => { 'X-Percona-Resource-Type' => 'Service' },
content => [ as_hashref($svc0) ], content => [ as_hashref($svc0, with_links => 1) ],
}, },
# interval, oktorun=0 # interval, oktorun=0
]; ];

View File

@@ -4,13 +4,14 @@
}, },
"name" : "query-monitor", "name" : "query-monitor",
"run_schedule" : "1 * * * *", "run_schedule" : "1 * * * *",
"runs" : [ "spool_schedule" : "2 * * * *",
"tasks" : [
{ {
"name" : "query-history",
"number" : "0", "number" : "0",
"options" : "--output json", "options" : "--output json",
"output" : "spool", "output" : "spool",
"program" : "pt-query-digest" "program" : "pt-query-digest"
} }
], ]
"spool_schedule" : "2 * * * *"
} }