Generate two elastic-recheck-graph json files all, and gate only

We want to display the hits for all queues and for just the gate queue.
A parameter was added to elastic-recheck-graph to support this, and a
second patch updates the web page to give the gate queue only option.
This patch updates the usage of elastic-recheck-gate.

Related elastic-recheck patchs:
 * I9217a2ceedf86ffe04851084df78238384fccd51
 * I23ed8d945c9517221622e1ca215c80539bb07bbd

Change-Id: Iac51aeaf152f50f8b9a064cd249b0920bef824df
This commit is contained in:
Joe Gordon 2014-01-30 13:51:34 -08:00
parent fe6641c027
commit 639113240c
2 changed files with 28 additions and 6 deletions

View File

@ -19,18 +19,29 @@
class elastic_recheck::cron () {
$er_state_path = $::elastic_recheck::recheck_state_dir
$graph_cmd = $::elastic_recheck::graph_cmd
$graph_all_cmd = $::elastic_recheck::graph_all_cmd
$graph_gate_cmd = $::elastic_recheck::graph_gate_cmd
$uncat_cmd = $::elastic_recheck::uncat_cmd
cron { 'elastic-recheck':
cron { 'elastic-recheck-all':
user => 'recheck',
minute => '*/15',
hour => '*',
command => "cd ${er_state_path} && er_safe_run.sh ${graph_cmd}",
command => "cd ${er_state_path} && er_safe_run.sh ${graph_all_cmd}",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
require => Class['elastic_recheck']
}
cron { 'elastic-recheck-gate':
user => 'recheck',
minute => '*/15',
hour => '*',
command => "sleep $((RANDOM\%60+90)) && cd ${er_state_path} && er_safe_run.sh ${graph_gate_cmd}",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
require => Class['elastic_recheck']
}
cron { 'elastic-recheck-uncat':
user => 'recheck',
minute => '59',

View File

@ -23,7 +23,8 @@ class elastic_recheck (
# any commit. So we need to define commands in a way that
# we can trigger an exec here, as well as on cron.
$recheck_state_dir = '/var/lib/elastic-recheck'
$graph_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o graph-new.json && mv graph-new.json graph.json'
$graph_all_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o all-new.json && mv all-new.json all.json'
$graph_gate_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o gate-new.json -q gate && mv gate-new.json gate.json'
$uncat_cmd = 'elastic-recheck-uncategorized -d /opt/elastic-recheck/queries -t /usr/local/share/elastic-recheck/templates -o uncategorized-new.html && mv uncategorized-new.html uncategorized.html'
group { 'recheck':
@ -45,8 +46,18 @@ class elastic_recheck (
source => 'https://git.openstack.org/openstack-infra/elastic-recheck',
}
exec { 'run_er_graph':
command => "er_safe_run.sh ${graph_cmd}",
exec { 'run_er_graph_all':
command => "er_safe_run.sh ${graph_all_cmd}",
path => '/usr/local/bin:/usr/bin:/bin/',
cwd => $recheck_state_dir,
user => 'recheck',
refreshonly => true,
require => File['/usr/local/bin/er_safe_run.sh'],
subscribe => Vcsrepo['/opt/elastic-recheck'],
}
exec { 'run_er_graph_gate_only':
command => "er_safe_run.sh ${graph_gate_cmd}",
path => '/usr/local/bin:/usr/bin:/bin/',
cwd => $recheck_state_dir,
user => 'recheck',