mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
33 lines
749 B
C++
33 lines
749 B
C++
#pragma once
|
|
|
|
#include "IServer.h"
|
|
#include "PrometheusMetricsWriter.h"
|
|
|
|
#include <Poco/Net/HTTPServerRequest.h>
|
|
#include <Poco/Net/HTTPServerResponse.h>
|
|
#include <Poco/Net/HTTPRequestHandler.h>
|
|
#include <Poco/Net/HTTPRequestHandlerFactory.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class PrometheusRequestHandler : public Poco::Net::HTTPRequestHandler
|
|
{
|
|
private:
|
|
IServer & server;
|
|
const PrometheusMetricsWriter & metrics_writer;
|
|
|
|
public:
|
|
explicit PrometheusRequestHandler(IServer & server_, const PrometheusMetricsWriter & metrics_writer_)
|
|
: server(server_)
|
|
, metrics_writer(metrics_writer_)
|
|
{
|
|
}
|
|
|
|
void handleRequest(
|
|
Poco::Net::HTTPServerRequest & request,
|
|
Poco::Net::HTTPServerResponse & response) override;
|
|
};
|
|
|
|
}
|