diff options
author | Sergey Polovko <sergey@polovko.me> | 2022-02-10 16:47:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:02 +0300 |
commit | 3e0b762a82514bac89c1dd6ea7211e381d8aa248 (patch) | |
tree | c2d1b379ecaf05ca8f11ed0b5da9d1a950e6e554 /library/cpp/monlib/service/monservice.h | |
parent | ab3783171cc30e262243a0227c86118f7080c896 (diff) | |
download | ydb-3e0b762a82514bac89c1dd6ea7211e381d8aa248.tar.gz |
Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib/service/monservice.h')
-rw-r--r-- | library/cpp/monlib/service/monservice.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/library/cpp/monlib/service/monservice.h b/library/cpp/monlib/service/monservice.h index 8f5e52fcdb..492bd9bec7 100644 --- a/library/cpp/monlib/service/monservice.h +++ b/library/cpp/monlib/service/monservice.h @@ -1,73 +1,73 @@ #pragma once -#include "service.h" +#include "service.h" #include "auth.h" -#include "mon_service_http_request.h" - -#include <library/cpp/monlib/service/pages/index_mon_page.h> -#include <library/cpp/monlib/service/pages/mon_page.h> - +#include "mon_service_http_request.h" + +#include <library/cpp/monlib/service/pages/index_mon_page.h> +#include <library/cpp/monlib/service/pages/mon_page.h> + #include <util/system/progname.h> - + #include <functional> namespace NMonitoring { - class TMonService2: public TMtHttpServer { - protected: - const TString Title; - char StartTime[26]; - TIntrusivePtr<TIndexMonPage> IndexMonPage; + class TMonService2: public TMtHttpServer { + protected: + const TString Title; + char StartTime[26]; + TIntrusivePtr<TIndexMonPage> IndexMonPage; THolder<IAuthProvider> AuthProvider_; - public: + public: static THttpServerOptions HttpServerOptions(ui16 port, const TString& host, ui32 threads) { - THttpServerOptions opts(port); + THttpServerOptions opts(port); if (!host.empty()) { opts.SetHost(host); } - opts.SetClientTimeout(TDuration::Minutes(1)); - opts.EnableCompression(true); - opts.SetThreads(threads); + opts.SetClientTimeout(TDuration::Minutes(1)); + opts.EnableCompression(true); + opts.SetThreads(threads); opts.SetMaxConnections(std::max<ui32>(100, threads)); opts.EnableRejectExcessConnections(true); - return opts; - } + return opts; + } static THttpServerOptions HttpServerOptions(ui16 port, ui32 threads) { return HttpServerOptions(port, TString(), threads); } - public: + public: explicit TMonService2(ui16 port, const TString& title = GetProgramName(), THolder<IAuthProvider> auth = nullptr); explicit TMonService2(ui16 port, ui32 threads, const TString& title = GetProgramName(), THolder<IAuthProvider> auth = nullptr); explicit TMonService2(ui16 port, const TString& host, ui32 threads, const TString& title = GetProgramName(), THolder<IAuthProvider> auth = nullptr); explicit TMonService2(const THttpServerOptions& options, const TString& title = GetProgramName(), THolder<IAuthProvider> auth = nullptr); explicit TMonService2(const THttpServerOptions& options, TSimpleSharedPtr<IThreadPool> pool, const TString& title = GetProgramName(), THolder<IAuthProvider> auth = nullptr); - ~TMonService2() override { - } + ~TMonService2() override { + } - const char* GetStartTime() const { - return StartTime; - } + const char* GetStartTime() const { + return StartTime; + } - const TString& GetTitle() const { - return Title; - } + const TString& GetTitle() const { + return Title; + } - virtual void ServeRequest(IOutputStream& out, const NMonitoring::IHttpRequest& request); - virtual void OutputIndex(IOutputStream& out); - virtual void OutputIndexPage(IOutputStream& out); - virtual void OutputIndexBody(IOutputStream& out); + virtual void ServeRequest(IOutputStream& out, const NMonitoring::IHttpRequest& request); + virtual void OutputIndex(IOutputStream& out); + virtual void OutputIndexPage(IOutputStream& out); + virtual void OutputIndexBody(IOutputStream& out); - void Register(IMonPage* page); + void Register(IMonPage* page); void Register(TMonPagePtr page); - TIndexMonPage* RegisterIndexPage(const TString& path, const TString& title); + TIndexMonPage* RegisterIndexPage(const TString& path, const TString& title); - IMonPage* FindPage(const TString& relativePath); - TIndexMonPage* FindIndexPage(const TString& relativePath); - void SortPages(); - }; + IMonPage* FindPage(const TString& relativePath); + TIndexMonPage* FindIndexPage(const TString& relativePath); + void SortPages(); + }; -} +} |