]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/bench/detailed_stat_collector.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
3 #ifndef DETAILEDSTATCOLLECTERH
4 #define DETAILEDSTATCOLLECTERH
6 #include "stat_collector.h"
7 #include "common/Formatter.h"
8 #include <boost/scoped_ptr.hpp>
9 #include "common/Mutex.h"
10 #include "common/Cond.h"
11 #include "include/utime.h"
14 #include <boost/tuple/tuple.hpp>
17 class DetailedStatCollector
: public StatCollector
{
19 class AdditionalPrinting
{
21 virtual void operator()(std::ostream
*) = 0;
22 virtual ~AdditionalPrinting() {}
37 : type(type
), start(start
), latency(latency
),
38 size(size
), seq(seq
) {}
39 void dump(ostream
*out
, Formatter
*f
);
44 double recent_latency
;
54 void add(const Op
&op
);
55 void dump(Formatter
*f
);
57 const double bin_size
;
58 boost::scoped_ptr
<Formatter
> f
;
61 boost::scoped_ptr
<AdditionalPrinting
> details
;
67 map
<string
, Aggregator
> aggregators
;
69 map
<uint64_t, pair
<uint64_t, utime_t
> > not_applied
;
70 map
<uint64_t, pair
<uint64_t, utime_t
> > not_committed
;
71 map
<uint64_t, pair
<uint64_t, utime_t
> > not_read
;
77 boost::tuple
<utime_t
, utime_t
, uint64_t, uint64_t> stuff
);
79 DetailedStatCollector(
84 AdditionalPrinting
*details
= 0
87 uint64_t next_seq() override
;
88 void start_write(uint64_t seq
, uint64_t size
) override
;
89 void start_read(uint64_t seq
, uint64_t size
) override
;
90 void write_applied(uint64_t seq
) override
;
91 void write_committed(uint64_t seq
) override
;
92 void read_complete(uint64_t seq
) override
;