Skip to content

Commit 1670b50

Browse files
committed
QLS tests: label the per-run number of actions
Both success, failing and total. Initial results: Actions total (100 in total): 55% NumActions "10 <= n < 100" 36% NumActions "1 <= n < 10" 7% NumActions "n == 0" 2% NumActions "100 <= n < 1000" Actions that succeeded total (100 in total): 52% NumActions "10 <= n < 100" 38% NumActions "1 <= n < 10" 9% NumActions "n == 0" 1% NumActions "100 <= n < 1000" Actions that failed total (100 in total): 68% NumActions "1 <= n < 10" 22% NumActions "n == 0" 10% NumActions "10 <= n < 100" As we can see, there's a surprising number of runs with no actions at all (7%) or no successful actions (9%). While it's important to get coverage of failing actions, we don't need lots of coverage since the reasons are always the same ones. There are not a lot of complex interactions in these cases. So we're wasting run actions on them.
1 parent 356d988 commit 1670b50

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

test/Test/Database/LSMTree/Normal/StateMachine.hs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,11 @@ data Stats = Stats {
13061306
, snapshotted :: Set R.SnapshotName
13071307
-- === Final tags (per action sequence, across all tables)
13081308
-- | Number of succesful lookups and their results
1309-
, numLookupsResults :: (Int, Int, Int) -- (NotFound, Found, FoundWithBlob)
1309+
, numLookupsResults :: {-# UNPACK #-} !(Int, Int, Int)
1310+
-- (NotFound, Found, FoundWithBlob)
13101311
-- | Number of succesful updates
1311-
, numUpdates :: (Int, Int, Int) -- (Insert, InsertWithBlob, Delete)
1312+
, numUpdates :: {-# UNPACK #-} !(Int, Int, Int)
1313+
-- (Insert, InsertWithBlob, Delete)
13121314
-- | Actions that succeeded
13131315
, successActions :: [String]
13141316
-- | Actions that failed with an error
@@ -1604,6 +1606,8 @@ data FinalTag =
16041606
-- (this includes submissions through both 'Class.updates' and
16051607
-- 'Class.deletes')
16061608
| NumDeletes String
1609+
-- | Total number of actions (failing, succeeding, either)
1610+
| NumActions String
16071611
-- | Which actions succeded
16081612
| ActionSuccess String
16091613
-- | Which actions failed
@@ -1623,6 +1627,7 @@ tagFinalState' :: Lockstep (ModelState h) -> [(String, [FinalTag])]
16231627
tagFinalState' (getModel -> ModelState finalState finalStats) = concat [
16241628
tagNumLookupsResults
16251629
, tagNumUpdates
1630+
, tagNumActions
16261631
, tagSuccessActions
16271632
, tagFailActions
16281633
, tagNumTables
@@ -1644,6 +1649,16 @@ tagFinalState' (getModel -> ModelState finalState finalStats) = concat [
16441649
]
16451650
where (i, iwb, d) = numUpdates finalStats
16461651

1652+
tagNumActions =
1653+
[ let n = length (successActions finalStats) in
1654+
("Actions that succeeded total", [NumActions (showPowersOf 10 n)])
1655+
, let n = length (failActions finalStats) in
1656+
("Actions that failed total", [NumActions (showPowersOf 10 n)])
1657+
, let n = length (successActions finalStats)
1658+
+ length (failActions finalStats) in
1659+
("Actions total", [NumActions (showPowersOf 10 n)])
1660+
]
1661+
16471662
tagSuccessActions =
16481663
[ ("Actions that succeeded", [ActionSuccess c])
16491664
| c <- successActions finalStats ]

0 commit comments

Comments
 (0)