kv/RocksDB: Add instrumentation to BinnedLRUCache
1) perf counters
For each cache section in perf counters is created.
"rocksdb-cache-O": {
"capacity":
134217728,
"usage":
134182832,
"pinned": 0,
"elems": 24502,
"inserts":
25806978,
"lookups":
150436987,
"hits":
124629911,
"misses":
25807076
}
In default configuration there are 2 sections: "rocksdb-cache-O", "rocksdb-cache-default".
2) admin command
For each cache admin command "rocksdb show cache x" is added.
> ./bin/ceph tell osd.0 rocksdb show cache O
shard capacity usage pinned elems inserts lookups hits misses
0
13631488 11076400 0 2099 136987 822679 685923 136756
1
13631488 11549712 0 2043 133359 571500 438383 133117
2
13631488 11060608 0 2232 135076 908468 773313 135155
3
13631488 11166896 0 2269 134006 427070 293147 133923
4
13631488 11117984 0 2297 133367 700242 567318 132924
5
13631488 11306672 0 2155 137501
1130135 991810 138325
6
13631488 11506512 0 2353 134515 662792 528514 134278
7
13631488 11093856 0 2316 135348 718971 583421 135550
8
13631488 11660624 0 2424 137363
1092043 954248 137795
9
13631488 10962000 0 2561 131982 431702 300467 131235
10
13631488 11379392 0 1916 134543 477118 342854 134264
11
13631488 11294272 0 2555 134508 512393 378337 134056
12
13631488 11277136 0 2079 137312
1131571 993692 137879
13
13631488 10887776 0 2543 134001 567073 432903 134170
14
13631488 10986528 0 2394 133288 584452 451018 133434
15
13631488 11954464 0 2456 134615 708285 573374 134911
3) admin command
" ./bin/ceph tell osd.0 rocksdb reset cache O" clears "inserts",
"lookups", "hits" and "misses"
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>