bool MgrMonitor::prepare_report(MonOpRequestRef op)
{
MMonMgrReport *m = static_cast<MMonMgrReport*>(op->get_req());
- pg_map = m->pg_map;
+ mon->pgservice.reset(m->pg_map);
return true;
}
#include "include/Context.h"
#include "MgrMap.h"
#include "PaxosService.h"
-#include "PGMap.h"
class MgrMonitor : public PaxosService
bool check_caps(MonOpRequestRef op, const uuid_d& fsid);
public:
- PGMap pg_map;
MgrMonitor(Monitor *mn, Paxos *p, const string& service_name)
: PaxosService(mn, p, service_name)
{}
osdmon()->osdmap.print_summary(f, cout);
f->close_section();
f->open_object_section("pgmap");
- mgrmon()->pg_map.print_summary(f, NULL);
+ pgservice.print_summary(f, NULL);
f->close_section();
f->open_object_section("fsmap");
mdsmon()->get_fsmap().print_summary(f, NULL);
osdmon()->osdmap.print_summary(NULL, ss);
ss << "\n \n data:\n";
- mgrmon()->pg_map.print_summary(NULL, &ss);
+ pgservice.print_summary(NULL, &ss);
ss << "\n ";
}
}
if (f)
f->open_object_section("stats");
- mgrmon()->pg_map.dump_fs_stats(&ds, f.get(), verbose);
+ pgservice.dump_fs_stats(&ds, f.get(), verbose);
if (!f)
ds << '\n';
- mgrmon()->pg_map.dump_pool_stats(osdmon()->osdmap, &ds, f.get(), verbose);
+ pgservice.dump_pool_stats(osdmon()->osdmap, &ds, f.get(), verbose);
if (f) {
f->close_section();
#include "Elector.h"
#include "Paxos.h"
#include "Session.h"
+#include "PGStatService.h"
#include "common/LogClient.h"
#include "auth/cephx/CephxKeyServer.h"
MgrClient mgr_client;
uint64_t mgr_proxy_bytes = 0; // in-flight proxied mgr command message bytes
+ PGStatService pgservice;
+
private:
void new_tick();
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2017 Greg Farnum/Red Hat <gfarnum@redhat.com>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+/**
+ * This service abstracts out the specific implementation providing information
+ * needed by parts of the Monitor based around PGStats. This'll make for
+ * an easier transition from the PGMonitor-based queries where we handle
+ * PGStats directly, to where we are getting information passed in from
+ * the Ceph Manager.
+ *
+ * This initial implementation cheats by wrapping a PGMap so we don't need
+ * to reimplement everything in one go.
+ */
+
+#ifndef CEPH_PGSTATSERVICE_H
+#define CEPH_PGSTATSERVICE_H
+
+#include "mon/PGMap.h"
+
+class PGStatService : public PGMap {
+ PGMap& parent;
+public:
+ PGStatService() : PGMap(),
+ parent(*static_cast<PGMap*>(this)) {}
+ PGStatService(const PGMap& o) : PGMap(o),
+ parent(*static_cast<PGMap*>(this)) {}
+ PGStatService& operator=(const PGMap& o) {
+ reset(o);
+ return *this;
+ }
+ void reset(const PGMap& o) {
+ parent = o;
+ }
+};
+
+
+#endif