Add elastic-recheck graphs to status

Change-Id: I0fb37f19bfe40dfbb8fd9a5ad9558f050480e537
This commit is contained in:
James E. Blair 2013-10-02 19:02:55 +00:00
parent 6ee3caea26
commit 2796923b75
3 changed files with 214 additions and 0 deletions

View File

@ -0,0 +1,70 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
lang="en">
<HEAD>
<TITLE>Elastic Recheck</TITLE>
<script type="text/javascript"
src="http://status.openstack.org/jquery.min.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/jquery-visibility.min.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/jquery-graphite.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/common.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/jquery.flot.min.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/jquery.flot.time.min.js"></script>
<script type="text/javascript"
src="elastic-recheck.js"></script>
<!-- Google Fonts -->
<link href='http://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin' rel='stylesheet' type='text/css'/>
<!-- Framework CSS -->
<link rel="stylesheet" href="http://www.openstack.org/themes/openstack/css/blueprint/screen.css" type="text/css" media="screen, projection"/>
<link rel="stylesheet" href="http://www.openstack.org/themes/openstack/css/blueprint/print.css" type="text/css" media="print"/>
<!-- IE CSS -->
<!--[if lt IE 8]><link rel="stylesheet" href="http://www.openstack.org/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
<!-- OpenStack Specific CSS -->
<link rel="stylesheet" href="http://www.openstack.org/themes/openstack/css/dropdown.css" type="text/css" media="screen, projection, print"/>
<!-- Page Specific CSS -->
<link rel="stylesheet" href="http://www.openstack.org/themes/openstack/css/home.css" type="text/css" media="screen, projection, print"/>
<link rel="stylesheet" type="text/css" href="http://www.openstack.org/themes/openstack/css/main.css" />
<style type="text/css">
.graph {
width: 600px;
height: 200px;
margin-bottom: 6px;
}
.extlink {
margin-left: 2em;
margin-right: 2em;
}
.bug-container {
margin-bottom: 2em;
}
</style>
<script type="text/javascript">
</script>
</HEAD>
<BODY>
<script type="text/javascript">header('Rechecks');</script>
<div id="main-container" class="container">
</div>
<script type="text/javascript">footer();</script>
</BODY>
</html>

View File

@ -0,0 +1,60 @@
// Copyright 2013 OpenStack Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
function update() {
$.getJSON('http://status.openstack.org/elastic-recheck/graph.json', function(data) {
var seen = [];
$.each(data, function(i, bug) {
var id = 'bug-'+bug['number'];
seen.push(id);
var div = $('#'+id);
if (!div.length) {
div = $('<div/>', {'id': id, 'class': 'bug-container'});
div.appendTo($('#main-container'));
$('<h2/>', {text: 'Bug ' + bug['number']}).appendTo(div);
$('<div/>', {'class': 'graph'}).appendTo(div);
$('<a/>', {
href: 'http://logstash.openstack.org/#'+bug['logstash_query'],
text: 'Logstash'
}).appendTo($('<span/>', {
'class': 'extlink'
}).appendTo(div));
$('<a/>', {
href: 'https://bugs.launchpad.net/bugs/'+bug['number'],
text: 'Launchpad'
}).appendTo($('<span/>', {
'class': 'extlink'
}).appendTo(div));
}
div = div.find(".graph");
$.plot(div, bug['data'],
{xaxis: {
mode: "time"
}}
);
});
$.each($('.bug-container'), function(i, container) {
if (seen.indexOf(container.id) == -1) {
container.remove();
}
});
});
}
$(function() {
update();
});

View File

@ -271,6 +271,90 @@ class openstack_project::static (
require => [File['/srv/static/status'],
Vcsrepo['/opt/jquery-graphite']],
}
vcsrepo { '/opt/flot':
ensure => latest,
provider => git,
revision => 'master',
source => 'https://github.com/flot/flot.git',
}
exec { 'install_flot' :
command => 'yui-compressor -o \'.js$:.min.js\' /opt/flot/jquery.flot*.js; mv /opt/flot/jquery.flot*.min.js /srv/static/status',
path => '/bin:/usr/bin',
refreshonly => true,
subscribe => Vcsrepo['/opt/flot'],
require => [File['/srv/static/status'],
Vcsrepo['/opt/flot']],
}
###########################################################
# Status - elastic-recheck
group { 'recheck':
ensure => 'present',
}
user { 'recheck':
ensure => present,
home => '/home/recheck',
shell => '/bin/bash',
gid => 'recheck',
require => Group['recheck'],
}
file { '/home/recheck':
ensure => directory,
mode => '0700',
owner => 'recheck',
group => 'recheck',
require => User['recheck'],
}
vcsrepo { '/opt/elastic-recheck':
ensure => latest,
provider => git,
revision => 'master',
source => 'https://git.openstack.org/openstack-infra/elastic-recheck',
}
include pip
exec { 'install_elastic-recheck' :
command => 'python setup.py install',
cwd => '/opt/elastic-recheck',
path => '/bin:/usr/bin',
refreshonly => true,
subscribe => Vcsrepo['/opt/elastic-recheck'],
require => Class['pip'],
}
file { '/srv/static/status/elastic-recheck':
ensure => directory,
owner => 'recheck',
group => 'recheck',
require => User['recheck'],
}
file { '/srv/static/status/elastic-recheck/index.html':
ensure => present,
source => 'puppet:///modules/openstack_project/elastic-recheck/elastic-recheck.html',
require => File['/srv/static/status/elastic-recheck'],
}
file { '/srv/static/status/elastic-recheck/elastic-recheck.js':
ensure => present,
source => 'puppet:///modules/openstack_project/elastic-recheck/elastic-recheck.js',
require => File['/srv/static/status/elastic-recheck'],
}
cron { 'elastic-recheck':
user => 'recheck',
minute => '*/15',
hour => '*',
command => 'elastic-recheck-graph /opt/elastic-recheck/queries.yaml -o /srv/static/status/elastic-recheck/graph-new.json && mv /srv/static/status/elastic-recheck/graph-new.json /srv/static/status/elastic-recheck/graph.json',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
require => [Vcsrepo['/opt/elastic-recheck'],
User['recheck']],
}
###########################################################
# Status - zuul