From: Erwan Velu Date: Mon, 21 Mar 2016 10:16:12 +0000 (+0100) Subject: tests: Reducing commands in get_num_active_clean() X-Git-Tag: v10.1.1~3^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3f7392d9d572e92b835d0069993e633d68d5f1b;p=ceph.git tests: Reducing commands in get_num_active_clean() get_num_active_clean() is called very often but spawn 1 useless process. The current "grep -v | wc -l" can be easily replaced by "grep -cv" which do the same while spawning one process less. Signed-off-by: Erwan Velu --- diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index c866df9f346..87eb82a9d92 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -940,7 +940,7 @@ function get_num_active_clean() { # grep -v '^$' ceph --format xml pg dump pgs 2>/dev/null | \ $XMLSTARLET sel -t -m "//pg_stat/state[$expression]" -v . -n | \ - grep -v '^$' | wc -l + grep -cv '^$' } function test_get_num_active_clean() {