Nir Soffer has uploaded a new change for review.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
contrib: Add tool for getting repoStats statistics
This tool is useful when debugging storage domain monitoring issues.
Examples:
$ repostat vdsm.log.* domain: ebcd25b1-1ab0-47e3-aa8b-83ee5f91b5bd delay avg: 0.093941 min: 0.000430 max: 1.499200 last check avg: 5.117508 min: 0.000000 max: 12.300000 domain: 6d7f7a48-4511-43b8-8abf-d323f7118b19 delay avg: 0.001090 min: 0.000300 max: 0.030056 last check avg: 4.975313 min: 0.000000 max: 10.200000
Change-Id: Id5f7828216058bb401f8a472fa5601e79542def1 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M Makefile.am A contrib/repostat 2 files changed, 55 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/38749/1
diff --git a/Makefile.am b/Makefile.am index 34885a1..7407b22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -49,6 +49,7 @@ autogen.sh \ build-aux/pkg-version \ contrib/profile-stats \ + contrib/repostat \ pylintrc \ vdsm.spec \ vdsm.spec.in \ @@ -80,6 +81,7 @@
WHITELIST = \ contrib/profile-stats \ + contrib/repostat \ init/daemonAdapter \ vdsm/get-conf-item \ vdsm/set-conf-item \ diff --git a/contrib/repostat b/contrib/repostat new file mode 100755 index 0000000..c140b4c --- /dev/null +++ b/contrib/repostat @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# +# Copyright 2015 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# +""" +Parse repoStats log lines and calculate statistics. + +Usage: repostat vdsm.log [...] +""" + +import fileinput +import re + +repostat_re = re.compile(r' Run and protect: repoStats, Return response: ') + +stats = {} + + +def liststat(a): + b = sorted(a) + return sum(b) / len(b), b[0], b[-1] + + +for line in fileinput.input(): + match = repostat_re.search(line) + if not match: + continue + response = eval(line[match.end():]) + for uuid, info in response.items(): + stats.setdefault(uuid, {'delays': [], 'checks': []}) + stats[uuid]['delays'].append(float(info['delay'])) + stats[uuid]['checks'].append(float(info['lastCheck'])) + +for uuid, info in stats.iteritems(): + print 'domain:', uuid + print ' delay avg: %f min: %f max: %f' % liststat(info['delays']) + print ' last check avg: %f min: %f max: %f' % liststat(info['checks'])
automation@ovirt.org has posted comments on this change.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
oVirt Jenkins CI Server has posted comments on this change.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/16682/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/16854/ : SUCCESS
Nir Soffer has posted comments on this change.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
Patch Set 1: Verified+1
Jenkins CI RO has abandoned this change.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
gerrit-hooks has posted comments on this change.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found
Nir Soffer has restored this change.
Change subject: contrib: Add tool for getting repoStats statistics ......................................................................
Restored
vdsm-patches@lists.fedorahosted.org