Skip to content

Commit

Permalink
t: cover kvs transaction stats
Browse files Browse the repository at this point in the history
Problem: There is no coverage for the new KVS transaction stats.

Add coverage in t1001-kvs-internals.t.
  • Loading branch information
chu11 committed Jan 18, 2025
1 parent ed44bc9 commit 4506ffa
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions t/t1001-kvs-internals.t
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,25 @@ test_expect_success 'kvs: 1 pending requests at end of tests before module remov
test $pendingcount1 -eq 1
'

#
# transaction module stats
#

test_expect_success 'kvs: module stats returns reasonable transaction stats' '
commitdata=$(flux module stats -p transactions.commit kvs) &&
echo $commitdata | jq -e ".count > 0" &&
echo $commitdata | jq -e ".min > 0" &&
echo $commitdata | jq -e ".max > 0" &&
echo $commitdata | jq -e ".mean > 0.0" &&
echo $commitdata | jq -e ".stddev >= 0.0" &&
fencedata=$(flux module stats -p transactions.fence kvs) &&
echo $fencedata | jq -e ".count > 0" &&
echo $fencedata | jq -e ".min > 0" &&
echo $fencedata | jq -e ".max > 0" &&
echo $fencedata | jq -e ".mean > 0.0" &&
echo $fencedata | jq -e ".stddev >= 0.0"
'

#
# test clear of stats
#
Expand All @@ -522,6 +541,21 @@ test_expect_success 'kvs: clear stats locally' '
flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0
'

test_expect_success 'kvs: clear of transaction stats works' '
commitdata=$(flux module stats -p transactions.commit kvs) &&
echo $commitdata | jq -e ".count == 0" &&
echo $commitdata | jq -e ".min == 0" &&
echo $commitdata | jq -e ".max == 0" &&
echo $commitdata | jq -e ".mean == 0.0" &&
echo $commitdata | jq -e ".stddev == 0.0" &&
fencedata=$(flux module stats -p transactions.fence kvs) &&
echo $fencedata | jq -e ".count == 0" &&
echo $fencedata | jq -e ".min == 0" &&
echo $fencedata | jq -e ".max == 0" &&
echo $fencedata | jq -e ".mean == 0.0" &&
echo $fencedata | jq -e ".stddev == 0.0"
'

test_expect_success NO_ASAN 'kvs: clear stats globally' '
flux kvs unlink -Rf $DIR &&
flux module stats -C kvs &&
Expand Down

0 comments on commit 4506ffa

Please sign in to comment.