]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: add perfcounters for pg info updates 11213/head
authorSage Weil <sage@redhat.com>
Tue, 18 Oct 2016 14:16:13 +0000 (10:16 -0400)
committerSage Weil <sage@redhat.com>
Tue, 18 Oct 2016 14:16:13 +0000 (10:16 -0400)
Note info updates (of any kind), fastinfo updates,
and biginfo updates.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PG.cc
src/osd/PG.h

index 40b14c112c84ecf743f6794e989d65f4e7cef210..d6c37d1aa4baac64708e55f81160345af10a3d63 100644 (file)
@@ -2591,6 +2591,13 @@ void OSD::create_logger()
   osd_plb.add_time_avg(l_osd_tier_promote_lat, "osd_tier_promote_lat", "Object promote latency");
   osd_plb.add_time_avg(l_osd_tier_r_lat, "osd_tier_r_lat", "Object proxy read latency");
 
+  osd_plb.add_u64_counter(l_osd_pg_info, "osd_pg_info",
+                         "PG updated its info (using any method)");
+  osd_plb.add_u64_counter(l_osd_pg_fastinfo, "osd_pg_fastinfo",
+                         "PG updated its info using fastinfo attr");
+  osd_plb.add_u64_counter(l_osd_pg_biginfo, "osd_pg_biginfo",
+                         "PG updated its biginfo attr");
+
   logger = osd_plb.create_perf_counters();
   cct->get_perfcounters_collection()->add(logger);
 }
index a15368bb3ab69a18eb8a0aff623abe831c067105..a08a34f45462363d9653305a6bc2da592d7b0f63 100644 (file)
@@ -158,6 +158,10 @@ enum {
   l_osd_tier_promote_lat,
   l_osd_tier_r_lat,
 
+  l_osd_pg_info,
+  l_osd_pg_fastinfo,
+  l_osd_pg_biginfo,
+
   l_osd_last,
 };
 
index 8f4ed7d072ca01510ecbf2ec0e2ba09b6fe99009..5557e41eea9891a0c3a94d6bcbf507912b7039df 100644 (file)
@@ -25,6 +25,7 @@
 #include "ScrubStore.h"
 
 #include "common/Timer.h"
+#include "common/perf_counters.h"
 
 #include "messages/MOSDOp.h"
 #include "messages/MOSDPGNotify.h"
@@ -2794,12 +2795,16 @@ int PG::_prepare_write_info(map<string,bufferlist> *km,
                            map<epoch_t,pg_interval_t> &past_intervals,
                            bool dirty_big_info,
                            bool dirty_epoch,
-                           bool try_fast_info)
+                           bool try_fast_info,
+                           PerfCounters *logger)
 {
   if (dirty_epoch) {
     ::encode(epoch, (*km)[epoch_key]);
   }
 
+  if (logger)
+    logger->inc(l_osd_pg_info);
+
   // try to do info efficiently?
   if (!dirty_big_info && try_fast_info &&
       info.last_update > last_written_info.last_update) {
@@ -2809,6 +2814,8 @@ int PG::_prepare_write_info(map<string,bufferlist> *km,
     assert(did);  // we verified last_update increased above
     if (info == last_written_info) {
       ::encode(fast, (*km)[fastinfo_key]);
+      if (logger)
+       logger->inc(l_osd_pg_fastinfo);
       return 0;
     }
     generic_dout(30) << __func__ << " fastinfo failed, info:\n";
@@ -2839,6 +2846,8 @@ int PG::_prepare_write_info(map<string,bufferlist> *km,
     ::encode(past_intervals, bigbl);
     ::encode(info.purged_snaps, bigbl);
     //dout(20) << "write_info bigbl " << bigbl.length() << dendl;
+    if (logger)
+      logger->inc(l_osd_pg_biginfo);
   }
 
   return 0;
@@ -2884,7 +2893,8 @@ void PG::prepare_write_info(map<string,bufferlist> *km)
                                last_written_info,
                                past_intervals,
                                dirty_big_info, need_update_epoch,
-                               g_conf->osd_fast_info);
+                               g_conf->osd_fast_info,
+                               osd->logger);
   assert(ret == 0);
   if (need_update_epoch)
     last_epoch = get_osdmap()->get_epoch();
index 0a8fbe04a6058b5e3f7bb1efe23f0dec70da83e9..9f53362a6c4ba07bba628db62029fc3146be17f6 100644 (file)
@@ -2243,7 +2243,8 @@ public:
     map<epoch_t,pg_interval_t> &past_intervals,
     bool dirty_big_info,
     bool dirty_epoch,
-    bool try_fast_info);
+    bool try_fast_info,
+    PerfCounters *logger = NULL);
   void write_if_dirty(ObjectStore::Transaction& t);
 
   eversion_t get_next_version() const {