X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Fosd%2FTestOpStat.h;fp=src%2Fceph%2Fsrc%2Ftest%2Fosd%2FTestOpStat.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=5bf4fc9595c359c44fc0a3c4a916cf11a8927df3;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/osd/TestOpStat.h b/src/ceph/src/test/osd/TestOpStat.h deleted file mode 100644 index 5bf4fc9..0000000 --- a/src/ceph/src/test/osd/TestOpStat.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -#include "common/Mutex.h" -#include "common/Cond.h" -#include "include/rados/librados.hpp" - -#ifndef TESTOPSTAT_H -#define TESTOPSTAT_H - -class TestOp; - -class TestOpStat { -public: - mutable Mutex stat_lock; - - TestOpStat() : stat_lock("TestOpStat lock") {} - - static uint64_t gettime() - { - timeval t; - gettimeofday(&t,0); - return (1000000*t.tv_sec) + t.tv_usec; - } - - class TypeStatus { - public: - map inflight; - multiset latencies; - void begin(TestOp *in) - { - assert(!inflight.count(in)); - inflight[in] = gettime(); - } - - void end(TestOp *in) - { - assert(inflight.count(in)); - uint64_t curtime = gettime(); - latencies.insert(curtime - inflight[in]); - inflight.erase(in); - } - - void export_latencies(map &in) const; - }; - map stats; - - void begin(TestOp *in); - void end(TestOp *in); - friend std::ostream & operator<<(std::ostream &, const TestOpStat &); -}; - -std::ostream & operator<<(std::ostream &out, const TestOpStat &rhs); - -#endif