summaryrefslogtreecommitdiffstats
path: root/tests/basic/stats-dump.t
diff options
context:
space:
mode:
authorRichard Wareing <rwareing@fb.com>2014-02-12 18:37:55 -0800
committerJeff Darcy <jdarcy@redhat.com>2015-10-08 05:44:27 -0700
commit722ed512220395af8a707756b49df67afacda795 (patch)
treeae2e4cf59a5b7fb33ecb506eb823bb049b520a05 /tests/basic/stats-dump.t
parentebe40c5047e7501a5bd1747cb4d62277ae0db6e9 (diff)
xlators: add JSON FOP statistics dumps every N seconds
Summary: - Adds a thread to the io-stats translator which dumps out statistics every N seconds where N is configurable by an option called "diagnostics.stats-dump-interval" - Thread cleanly starts/stops when translator is unloaded - Updates macros to use "Atomic Builtins" (e.g. intel CPU extentions) to use memory barries to update counters vs using locks. This should reduce overhead and prevent any deadlock bugs due to lock contention. Test Plan: - Test on development machine - Run prove -v tests/basic/stats-dump.t Change-Id: If071239d8fdc185e4e8fd527363cc042447a245d BUG: 1266476 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/12209 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'tests/basic/stats-dump.t')
-rw-r--r--tests/basic/stats-dump.t43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/basic/stats-dump.t b/tests/basic/stats-dump.t
new file mode 100644
index 00000000000..0a680e44e55
--- /dev/null
+++ b/tests/basic/stats-dump.t
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+. $(dirname $0)/../nfs.rc
+
+cleanup;
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
+TEST $CLI volume set $V0 diagnostics.latency-measurement on
+TEST $CLI volume set $V0 diagnostics.count-fop-hits on
+TEST $CLI volume set $V0 diagnostics.stats-dump-interval 1
+TEST $CLI volume set $V0 nfs.disable off
+TEST $CLI volume start $V0
+sleep 1
+TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
+TEST mount_nfs $H0:/$V0 $N0 nolock,soft,intr
+
+for i in {1..10};do
+ dd if=/dev/zero of=$M0/fuse_testfile$i bs=4k count=100
+done
+
+for i in {1..10};do
+ dd if=/dev/zero of=$N0/nfs_testfile$i bs=4k count=100
+done
+sleep 2
+
+# Verify we have non-zero write counts from the bricks, gNFSd
+# and the FUSE mount
+BRICK_OUTPUT="$(grep 'aggr.fop.write.count": "0"' ${GLUSTERD_WORKDIR}/stats/glusterfsd__d_backends_patchy?.dump)"
+BRICK_RET="$?"
+NFSD_OUTPUT="$(grep 'aggr.fop.write.count": "0"' ${GLUSTERD_WORKDIR}/stats/glusterfs_nfsd.dump)"
+NFSD_RET="$?"
+FUSE_OUTPUT="$(grep 'aggr.fop.write.count": "0"' ${GLUSTERD_WORKDIR}/stats/glusterfs_patchy.dump)"
+FUSE_RET="$?"
+
+TEST [ 0 -ne "$BRICK_RET" ]
+TEST [ 0 -ne "$NFSD_RET" ]
+TEST [ 0 -ne "$FUSE_RET" ]
+
+cleanup;