Skip to content

Commit

Permalink
tests: rbd/admin_socket: use xmlstarlet when parsing perf dump
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
  • Loading branch information
Mykola Golub committed Nov 10, 2015
1 parent 98b4b1c commit 9c1ebcb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions qa/workunits/rbd/test_admin_socket.sh
Expand Up @@ -36,9 +36,15 @@ function rbd_get_perfcounter()
{
local image=$1
local counter=$2
local name

ceph --admin-daemon $(rbd_watch_asok ${image}) perf dump |
sed -ne 's/^.*"'${counter}'": \([0-9]*\).*$/\1/p'
name=$(ceph --format xml --admin-daemon $(rbd_watch_asok ${image}) \
perf schema | $XMLSTARLET el -d3 |
grep "/librbd-.*-${image}/${counter}\$")
test -n "${name}" || return 1

ceph --format xml --admin-daemon $(rbd_watch_asok ${image}) perf dump |
$XMLSTARLET sel -t -m "${name}" -v .
}

function rbd_check_perfcounter()
Expand Down

0 comments on commit 9c1ebcb

Please sign in to comment.