使用rocksDB作为后端从ARDB获取定期统计信息

时间:2016-08-17 15:16:58

标签: monitoring rocksdb

ardb 中的类似命令,例如 memcached 中的stats,它给出了累计getset操作的数量单独以及其他统计信息,例如misses

e.g。在memcached中我可以执行stats命令,它给出了:

STAT pid 1905
STAT uptime 87713
STAT time 1469108527
STAT version 1.4.25
STAT libevent 2.0.21-stable
STAT pointer_size 64
STAT rusage_user 300.101330
STAT rusage_system 711.654138
STAT curr_connections 18
STAT total_connections 4698
STAT connection_structures 739
STAT reserved_fds 40
STAT cmd_get 75355568
STAT cmd_set 3296663
STAT cmd_flush 0
STAT cmd_touch 0
STAT get_hits 44369791
STAT get_misses 30985777
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 3615072874
STAT bytes_written 16173356516
STAT limit_maxbytes 3670016000
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT time_in_listen_disabled_us 0
STAT threads 8
STAT conn_yields 1763246
STAT hash_power_level 17
STAT hash_bytes 1048576
STAT hash_is_expanding 0
STAT malloc_fails 0
STAT bytes 331012787
STAT curr_items 176322
STAT total_items 3296663
STAT expired_unfetched 0
STAT evicted_unfetched 0
STAT evictions 0
STAT reclaimed 0
STAT crawler_reclaimed 0
STAT crawler_items_checked 0
STAT lrutail_reflocked 0
END

使用这个我可以在最后一秒找出get操作的数量(通过在python中使用任何客户端库减去)。我想获得ardb每秒的get和set操作数。

我找到的唯一命令是info commandstats,它给出了:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
info commandstats
$128
# Commandstats
cmdstat_get:calls=755061,usec=2009117846,usecpercall=2660
cmdstat_info:calls=23,usec=87805,usecpercall=3817

虽然这可以为我提供get个统计信息,但setmisses没有任何内容。是否有类似于ardb或某些黑客可以获取此信息?我使用rocksdb作为后端,需要一些用于从python监控的东西。

P.S 我因为低代表而无法创建ardb代码,也许其他人可以创建它?

0 个答案:

没有答案