Skip to content

Commit 7399b19

Browse files
committed
[lmdb facebookincubator#5] Enable RockDB cache in benchmarks
1 parent 8fba283 commit 7399b19

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

glean/bench/BenchDB.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ withBenchDB conf num act = do
3939
| useLMDB conf = [setLMDBStorage]
4040
| otherwise = []
4141

42-
withEmptyTestDB settings $ \env repo -> do
42+
withEmptyTestDB (enableRocksDBCache : settings) $ \env repo -> do
4343
withOpenDatabase env repo $ \odb ->
4444
void $ return odb
4545

glean/test/lib/Glean/Database/Test.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module Glean.Database.Test
2222
, setMaxSetSize
2323
, enableTcDebug
2424
, enableQueryDebug
25+
, enableRocksDBCache
2526
, withTestEnv
2627
, kickOffTestDB
2728
, waitUntilComplete
@@ -120,6 +121,13 @@ enableQueryDebug :: Setting
120121
enableQueryDebug cfg = cfg
121122
{ cfgDebug = (cfgDebug cfg) { queryDebug = True } }
122123

124+
enableRocksDBCache :: Setting
125+
enableRocksDBCache cfg = cfg
126+
{ cfgServerConfig = (cfgServerConfig cfg) <&> \scfg -> scfg
127+
{ ServerConfig.config_db_rocksdb_cache_mb =
128+
ServerConfig.config_db_rocksdb_cache_mb def }
129+
}
130+
123131
withTestEnv
124132
:: [Setting]
125133
-> (Env -> IO a)

0 commit comments

Comments
 (0)