]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: enable 'qlen' & 'qactive' performance counters 20842/head
authorMark Kogan <mkogan@redhat.com>
Mon, 12 Mar 2018 09:40:56 +0000 (05:40 -0400)
committerMark Kogan <mkogan@redhat.com>
Mon, 12 Mar 2018 10:01:44 +0000 (06:01 -0400)
when using the Civetweb and Beast frontends

fixes: https://tracker.ceph.com/issues/23147

Signed-off-by: Mark Kogan <mkogan@redhat.com>
src/rgw/rgw_asio_client.cc
src/rgw/rgw_civetweb.cc

index 57dbd6b189bf2eb40b312d5b9021dfde9b521dab..0ad801667b2f8437c0479aa38af3ae0ee2597db0 100644 (file)
@@ -24,6 +24,9 @@ int ClientIO::init_env(CephContext *cct)
 {
   env.init(cct);
 
+  perfcounter->inc(l_rgw_qlen);
+  perfcounter->inc(l_rgw_qactive);
+
   const auto& request = parser.get();
   const auto& headers = request;
   for (auto header = headers.begin(); header != headers.end(); ++header) {
@@ -123,6 +126,8 @@ size_t ClientIO::read_data(char* buf, size_t max)
 
 size_t ClientIO::complete_request()
 {
+  perfcounter->inc(l_rgw_qlen, -1);
+  perfcounter->inc(l_rgw_qactive, -1);
   return 0;
 }
 
index 098153c10596c35a3ba74f2db1cdd9a958fe1297..37c65e4061b7f9064664428d9a595a22cdbae97c 100644 (file)
@@ -64,6 +64,8 @@ void RGWCivetWeb::flush()
 
 size_t RGWCivetWeb::complete_request()
 {
+  perfcounter->inc(l_rgw_qlen, -1);
+  perfcounter->inc(l_rgw_qactive, -1);
   return 0;
 }
 
@@ -117,6 +119,9 @@ int RGWCivetWeb::init_env(CephContext *cct)
     env.set(buf, value);
   }
 
+  perfcounter->inc(l_rgw_qlen);
+  perfcounter->inc(l_rgw_qactive);
+
   env.set("REMOTE_ADDR", info->remote_addr);
   env.set("REQUEST_METHOD", info->request_method);
   env.set("HTTP_VERSION", info->http_version);