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) 2013 Inktank, Inc
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.
14 #ifndef CEPH_MON_DATA_HEALTH_SERVICE_H
15 #define CEPH_MON_DATA_HEALTH_SERVICE_H
19 #include "include/types.h"
20 #include "mon/mon_types.h"
21 #include "mon/HealthService.h"
22 #include "common/config.h"
23 #include "global/signal_handler.h"
26 namespace ceph
{ class Formatter
; }
29 class DataHealthService
:
32 map
<entity_inst_t
,DataStats
> stats
;
33 int last_warned_percent
;
35 void handle_tell(MonOpRequestRef op
);
36 int update_store_stats(DataStats
&ours
);
40 void force_shutdown() {
41 generic_dout(0) << "** Shutdown via Data Health Service **" << dendl
;
42 queue_async_signal(SIGINT
);
46 void service_tick() override
;
47 bool service_dispatch_op(MonOpRequestRef op
) override
;
48 void service_shutdown() override
{ }
50 void start_epoch() override
;
51 void finish_epoch() override
{ }
52 void cleanup() override
{ }
55 DataHealthService(Monitor
*m
) :
57 last_warned_percent(0)
59 set_update_period(g_conf
->mon_health_data_update_interval
);
61 ~DataHealthService() override
{ }
63 void init() override
{
64 generic_dout(20) << "data_health " << __func__
<< dendl
;
68 void get_health(Formatter
*f
,
69 list
<pair
<health_status_t
,string
> >& summary
,
70 list
<pair
<health_status_t
,string
> > *detail
) override
;
72 int get_type() override
{
73 return HealthService::SERVICE_HEALTH_DATA
;
76 string
get_name() const override
{
81 #endif /* CEPH_MON_DATA_HEALTH_SERVICE_H */