registry_mon_page.h 1022 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "pre_mon_page.h"
  3. #include <library/cpp/monlib/metrics/metric_registry.h>
  4. namespace NMonitoring {
  5. // For now this class can only enumerate all metrics without any grouping or serve JSON/Spack/Prometheus
  6. class TMetricRegistryPage: public TPreMonPage {
  7. public:
  8. TMetricRegistryPage(const TString& path, const TString& title, TAtomicSharedPtr<IMetricSupplier> registry)
  9. : TPreMonPage(path, title)
  10. , Registry_(registry)
  11. , RegistryRawPtr_(Registry_.Get())
  12. {
  13. }
  14. TMetricRegistryPage(const TString& path, const TString& title, IMetricSupplier* registry)
  15. : TPreMonPage(path, title)
  16. , RegistryRawPtr_(registry)
  17. {
  18. }
  19. void Output(NMonitoring::IMonHttpRequest& request) override;
  20. void OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) override;
  21. private:
  22. TAtomicSharedPtr<IMetricSupplier> Registry_;
  23. IMetricSupplier* RegistryRawPtr_;
  24. };
  25. }