diff options
Diffstat (limited to 'src/file_handle_cache_stats.erl')
-rw-r--r-- | src/file_handle_cache_stats.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/file_handle_cache_stats.erl b/src/file_handle_cache_stats.erl index 832f0b3d..de2f90c6 100644 --- a/src/file_handle_cache_stats.erl +++ b/src/file_handle_cache_stats.erl @@ -22,13 +22,20 @@ -define(TABLE, ?MODULE). +-define(COUNT, + [io_reopen, mnesia_ram_tx, mnesia_disk_tx, + msg_store_read, msg_store_write, + queue_index_journal_write, queue_index_write, queue_index_read]). +-define(COUNT_TIME, [io_sync, io_seek]). +-define(COUNT_TIME_BYTES, [io_read, io_write]). + init() -> ets:new(?TABLE, [public, named_table]), - [ets:insert(?TABLE, {{Op, Counter}, 0}) || Op <- [read, write], + [ets:insert(?TABLE, {{Op, Counter}, 0}) || Op <- ?COUNT_TIME_BYTES, Counter <- [count, bytes, time]], - [ets:insert(?TABLE, {{Op, Counter}, 0}) || Op <- [sync, seek], + [ets:insert(?TABLE, {{Op, Counter}, 0}) || Op <- ?COUNT_TIME, Counter <- [count, time]], - [ets:insert(?TABLE, {{Op, Counter}, 0}) || Op <- [reopen], + [ets:insert(?TABLE, {{Op, Counter}, 0}) || Op <- ?COUNT, Counter <- [count]]. update(Op, Bytes, Thunk) -> |