]>
git.proxmox.com Git - ceph.git/blob - ceph/src/kv/KeyValueHistogram.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #ifndef KeyValueHistogram_H
4 #define KeyValueHistogram_H
8 #include "common/Formatter.h"
12 * Key Value DB Histogram generator
15 struct KeyValueHistogram
{
24 std::map
<int, struct value_dist
> val_map
; ///< slab id to count, max length of value and key
27 std::map
<std::string
, std::map
<int, struct key_dist
> > key_hist
;
28 std::map
<int, uint64_t> value_hist
;
29 int get_key_slab(size_t sz
);
30 std::string
get_key_slab_to_range(int slab
);
31 int get_value_slab(size_t sz
);
32 std::string
get_value_slab_to_range(int slab
);
33 void update_hist_entry(std::map
<std::string
, std::map
<int, struct key_dist
> >& key_hist
,
34 const std::string
& prefix
, size_t key_size
, size_t value_size
);
35 void dump(ceph::Formatter
* f
);