X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Fosd%2FTestOpStat.cc;fp=src%2Fceph%2Fsrc%2Ftest%2Fosd%2FTestOpStat.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=e8045fa43fbef34b692e538c7b37ff5a6644823f;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/osd/TestOpStat.cc b/src/ceph/src/test/osd/TestOpStat.cc deleted file mode 100644 index e8045fa..0000000 --- a/src/ceph/src/test/osd/TestOpStat.cc +++ /dev/null @@ -1,61 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -#include "include/interval_set.h" -#include "include/buffer.h" -#include -#include -#include -#include "RadosModel.h" -#include "TestOpStat.h" - -void TestOpStat::begin(TestOp *in) { - stat_lock.Lock(); - stats[in->getType()].begin(in); - stat_lock.Unlock(); -} - -void TestOpStat::end(TestOp *in) { - stat_lock.Lock(); - stats[in->getType()].end(in); - stat_lock.Unlock(); -} - -void TestOpStat::TypeStatus::export_latencies(map &in) const -{ - map::iterator i = in.begin(); - multiset::iterator j = latencies.begin(); - int count = 0; - while (j != latencies.end() && i != in.end()) { - count++; - if ((((double)count)/((double)latencies.size())) * 100 >= i->first) { - i->second = *j; - ++i; - } - ++j; - } -} - -std::ostream & operator<<(std::ostream &out, const TestOpStat &rhs) -{ - rhs.stat_lock.Lock(); - for (auto i = rhs.stats.begin(); - i != rhs.stats.end(); - ++i) { - map latency; - latency[10] = 0; - latency[50] = 0; - latency[90] = 0; - latency[99] = 0; - i->second.export_latencies(latency); - - out << i->first << " latency: " << std::endl; - for (map::iterator j = latency.begin(); - j != latency.end(); - ++j) { - if (j->second == 0) break; - out << "\t" << j->first << "th percentile: " - << j->second / 1000 << "ms" << std::endl; - } - } - rhs.stat_lock.Unlock(); - return out; -}