plb.add_u64_counter(l_rgw_keystone_token_cache_hit, "keystone_token_cache_hit", "Keystone token cache hits");
plb.add_u64_counter(l_rgw_keystone_token_cache_miss, "keystone_token_cache_miss", "Keystone token cache miss");
+ plb.add_u64_counter(l_rgw_gc_retire, "gc_retire_object", "GC object retires");
+
perfcounter = plb.create_perf_counters();
cct->get_perfcounters_collection()->add(perfcounter);
return 0;
l_rgw_keystone_token_cache_hit,
l_rgw_keystone_token_cache_miss,
+ l_rgw_gc_retire,
+
l_rgw_last,
};
- /* size should be the required string size + 1 */
+/* size should be the required string size + 1 */
int gen_rand_base64(CephContext *cct, char *dest, int size);
void gen_rand_alphanumeric(CephContext *cct, char *dest, int size);
void gen_rand_alphanumeric_lower(CephContext *cct, char *dest, int size);
// vim: ts=8 sw=2 smarttab
#include "rgw_gc.h"
+
+#include "include/scope_guard.h"
#include "include/rados/librados.hpp"
#include "cls/rgw/cls_rgw_client.h"
#include "cls/refcount/cls_refcount_client.h"
#include "cls/lock/cls_lock_client.h"
#include "include/random.h"
-#include <list>
+#include <list> // XXX
#include <sstream>
#define dout_context g_ceph_context
" removing entries from gc log shard index=" << index << ", size=" <<
rt.size() << ", entries=[" << lister() << "]" << dendl;
+ auto rt_guard = make_scope_guard(
+ [&]
+ {
+ rt.clear();
+ }
+ );
+
int ret = gc->remove(index, rt, &index_io.c);
- rt.clear();
if (ret < 0) {
/* we already cleared list of tags, this prevents us from
* ballooning in case of a persistent problem
index << " ret=" << ret << dendl;
return;
}
-
+ if (perfcounter) {
+ /* log the count of tags retired for rate estimation */
+ perfcounter->inc(l_rgw_gc_retire, rt.size());
+ }
ios.push_back(index_io);
}