#include "common/errno.h"
#include "common/Clock.h"
#include "common/Formatter.h"
+#include "common/perf_counters.h"
#include "auth/Crypto.h"
#include <sstream>
#define DOUT_SUBSYS rgw
+PerfCounters *perfcounter = NULL;
+
+int rgw_perf_start(CephContext *cct)
+{
+ PerfCountersBuilder plb(cct, cct->_conf->name.to_str(), l_rgw_first, l_rgw_last);
+
+ plb.add_u64_counter(l_rgw_get, "get");
+ plb.add_u64_counter(l_rgw_get_b, "get_b");
+ plb.add_fl_avg(l_rgw_get_lat, "get_lat");
+ plb.add_u64_counter(l_rgw_put, "put");
+ plb.add_u64_counter(l_rgw_put_b, "put_b");
+ plb.add_fl_avg(l_rgw_put_lat, "put_lat");
+
+ plb.add_u64(l_rgw_qlen, "qlen");
+ plb.add_u64(l_rgw_qactive, "qactive");
+
+ perfcounter = plb.create_perf_counters();
+ cct->get_perfcounters_collection()->add(perfcounter);
+ return 0;
+}
+
+void rgw_perf_stop(CephContext *cct)
+{
+ assert(perfcounter);
+ cct->get_perfcounters_collection()->remove(perfcounter);
+ delete perfcounter;
+}
+
+
using namespace ceph::crypto;
rgw_err::
#include "common/ceph_crypto.h"
#include "common/debug.h"
+#include "common/perf_counters.h"
#include "acconfig.h"
#ifdef FASTCGI_INCLUDE_DIR
typedef void *RGWAccessHandle;
+
+/* perf counter */
+
+extern PerfCounters *perfcounter;
+
+extern int rgw_perf_start(CephContext *cct);
+extern void rgw_perf_stop(CephContext *cct);
+
+enum {
+ l_rgw_first = 15000,
+ l_rgw_req,
+
+ l_rgw_get,
+ l_rgw_get_b,
+ l_rgw_get_lat,
+
+ l_rgw_put,
+ l_rgw_put_b,
+ l_rgw_put_lat,
+
+ l_rgw_qlen,
+ l_rgw_qactive,
+
+ l_rgw_last,
+};
+
+
/* size should be the required string size + 1 */
extern int gen_rand_base64(char *dest, int size);
extern int gen_rand_alphanumeric(char *dest, int size);