golovan_page.h 660 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "counters.h"
  3. #include <library/cpp/monlib/service/pages/mon_page.h>
  4. #include <util/generic/ptr.h>
  5. #include <functional>
  6. // helper class to output json for Golovan.
  7. class TGolovanCountersPage: public NMonitoring::IMonPage {
  8. public:
  9. using TOutputCallback = std::function<void()>;
  10. const TIntrusivePtr<NMonitoring::TDynamicCounters> Counters;
  11. TGolovanCountersPage(const TString& path, TIntrusivePtr<NMonitoring::TDynamicCounters> counters,
  12. TOutputCallback outputCallback = nullptr);
  13. void Output(NMonitoring::IMonHttpRequest& request) override;
  14. private:
  15. TOutputCallback OutputCallback;
  16. };