rgw: enable 'qlen' & 'qactive' performance counters

when using the Civetweb and Beast frontends

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

Signed-off-by: Mark Kogan <mkogan@redhat.com>
This commit is contained in:
Mark Kogan 2018-03-12 05:40:56 -04:00
parent a0a001a8df
commit fc1c19714b
2 changed files with 10 additions and 0 deletions

View 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;
}

View 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);