Skip to content

Commit fbd217b

Browse files
committed
QLS: miscellaneous fixes for tagging functions
1 parent 5bbbe04 commit fbd217b

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

test/Test/Database/LSMTree/StateMachine.hs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,9 @@ updateStats action@(Action _merrs action') lookUp modelBefore _modelAfter result
22902290
(Deletes ks _, MEither (Right (MUnit ()))) -> stats {
22912291
numUpdates = countAll $ V.map (\k -> (k, R.Delete)) ks
22922292
}
2293+
(Mupserts mups _, MEither (Right (MUnit ()))) -> stats {
2294+
numUpdates = countAll $ V.map (second R.Mupsert) mups
2295+
}
22932296
_ -> stats
22942297
where
22952298
countAll :: forall k v b. V.Vector (k, R.Update v b) -> (Int, Int, Int, Int)
@@ -2381,8 +2384,8 @@ updateStats action@(Action _merrs action') lookUp modelBefore _modelAfter result
23812384
(numActionsPerTable stats)
23822385
}
23832386

2384-
updClosedTableSizes stats = case action' of
2385-
Close tableVar
2387+
updClosedTableSizes stats = case (action', result) of
2388+
(Close tableVar, MEither (Right (MUnit ())))
23862389
| MTable t <- lookUp tableVar
23872390
, let tid = Model.tableID t
23882391
-- This lookup can fail if the table was already closed:
@@ -2438,19 +2441,39 @@ updateStats action@(Action _merrs action') lookUp modelBefore _modelAfter result
24382441
case action' of
24392442
Lookups ks tableVar
24402443
| not (null ks) -> updateLastActionLog tableVar
2444+
| otherwise -> stats
24412445
RangeLookup r tableVar
24422446
| not (emptyRange r) -> updateLastActionLog tableVar
2447+
| otherwise -> stats
24432448
NewCursor _ tableVar -> updateLastActionLog tableVar
24442449
Updates upds tableVar
24452450
| not (null upds) -> updateLastActionLog tableVar
2451+
| otherwise -> stats
24462452
Inserts ins tableVar
24472453
| not (null ins) -> updateLastActionLog tableVar
2454+
| otherwise -> stats
24482455
Deletes ks tableVar
24492456
| not (null ks) -> updateLastActionLog tableVar
2457+
| otherwise -> stats
2458+
Mupserts mups tableVar
2459+
| not (null mups) -> updateLastActionLog tableVar
2460+
| otherwise -> stats
24502461
Close tableVar -> updateLastActionLog tableVar
2451-
-- TODO: pattern match on all constructors so don't we don't miss any
2452-
-- (in the future)
2453-
_ -> stats
2462+
-- Uninteresting actions
2463+
New{} -> stats
2464+
CloseCursor{} -> stats
2465+
ReadCursor{} -> stats
2466+
RetrieveBlobs{} -> stats
2467+
CreateSnapshot{} -> stats
2468+
OpenSnapshot{} -> stats
2469+
DeleteSnapshot{} -> stats
2470+
ListSnapshots{} -> stats
2471+
Duplicate{} -> stats
2472+
Union{} -> stats
2473+
Unions{} -> stats
2474+
RemainingUnionDebt{} -> stats
2475+
SupplyUnionCredits{} -> stats
2476+
SupplyPortionOfDebt{} -> stats
24542477
where
24552478
-- add the current table to the front of the list of tables, if it's
24562479
-- not the latest one already

0 commit comments

Comments
 (0)