1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2016 John Spray <john.spray@redhat.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_MMGRCONFIGURE_H_
16 #define CEPH_MMGRCONFIGURE_H_
18 #include "msg/Message.h"
21 * This message is sent from ceph-mgr to MgrClient, instructing it
22 * it about what data to send back to ceph-mgr at what frequency.
24 class MMgrConfigure : public Message
26 static const int HEAD_VERSION = 2;
27 static const int COMPAT_VERSION = 1;
30 uint32_t stats_period;
32 // Default 0 means if unspecified will include all stats
33 uint32_t stats_threshold = 0;
35 void decode_payload() override
37 bufferlist::iterator p = payload.begin();
38 ::decode(stats_period, p);
39 if (header.version >= 2) {
40 ::decode(stats_threshold, p);
44 void encode_payload(uint64_t features) override {
45 ::encode(stats_period, payload);
46 ::encode(stats_threshold, payload);
49 const char *get_type_name() const override { return "mgrconfigure"; }
50 void print(ostream& out) const override {
51 out << get_type_name() << "(period=" << stats_period
52 << ", threshold=" << stats_threshold << ")";
56 : Message(MSG_MGR_CONFIGURE, HEAD_VERSION, COMPAT_VERSION)