Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions glean/db/Glean/Database/Storage/RocksDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ data RocksDB = RocksDB
, rocksCache :: Maybe Cache
, rocksCacheIndexAndFilterBlocks :: Bool
, rocksMaxDiskSize :: Maybe Int
-- ^ virtual limit to report capped disk capacities. The limit is
-- ^ virtual limit (bytes) to report capped disk capacities. The limit is
-- not enforced. It's up to each io usage to check diskspace before writing.
-- We're using this to avoid serving too many dbs on query servers,
-- and smarter sharding.
Expand All @@ -82,14 +82,14 @@ newStorage root ServerConfig.Config{..} = do
then
Just <$> newCache (fromIntegral config_db_rocksdb_cache_mb * 1024 * 1024)
else return Nothing
mem_capacity <- totalMemCapacity
mem_capacity <- totalMemCapacityKB
return RocksDB
{ rocksRoot = root
, rocksCache = cache
, rocksCacheIndexAndFilterBlocks =
config_db_rocksdb_cache_index_and_filter_blocks
, rocksMaxDiskSize = case mem_capacity of
Just mem -> (* mem) . fromIntegral <$>
Just mem -> (* (mem * 1024)) . fromIntegral <$>
config_db_rocksdb_disk_mem_capacity_ratio_limit
Nothing -> Nothing
}
Expand Down
6 changes: 3 additions & 3 deletions glean/util/Glean/Impl/MemoryReader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
-}

module Glean.Impl.MemoryReader
(totalMemCapacity
(totalMemCapacityKB
) where

-- template for open source build
-- not implemented yet
totalMemCapacity :: IO (Maybe Int)
totalMemCapacity = return Nothing
totalMemCapacityKB :: IO (Maybe Int)
totalMemCapacityKB = return Nothing
Loading