Merge pull request #20842 from mkogan1/wip-rgw-23147

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

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Casey Bodley 2018-03-23 09:53:03 -04:00 committed by GitHub
commit 6329d44301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -75,6 +75,8 @@ void RGWCivetWeb::flush()
size_t RGWCivetWeb::complete_request()
{
perfcounter->inc(l_rgw_qlen, -1);
perfcounter->inc(l_rgw_qactive, -1);
return 0;
}
@ -128,6 +130,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);