aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/dynamic_counters/golovan_page.h
blob: e1772c773453339846369fec4ba6fa5555e7a993 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "counters.h"

#include <library/cpp/monlib/service/pages/mon_page.h>

#include <util/generic/ptr.h>

#include <functional>

// helper class to output json for Golovan.
class TGolovanCountersPage: public NMonitoring::IMonPage {
public:
    using TOutputCallback = std::function<void()>;

    const TIntrusivePtr<NMonitoring::TDynamicCounters> Counters;

    TGolovanCountersPage(const TString& path, TIntrusivePtr<NMonitoring::TDynamicCounters> counters,
                         TOutputCallback outputCallback = nullptr);

    void Output(NMonitoring::IMonHttpRequest& request) override;

private:
    TOutputCallback OutputCallback;
};