Skip to content

Commit

Permalink
Merge de62eac into 09f56af
Browse files Browse the repository at this point in the history
  • Loading branch information
khvorov committed Dec 10, 2018
2 parents 09f56af + de62eac commit 61075ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pull/include/prometheus/exposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class MetricsHandler;
class Exposer {
public:
explicit Exposer(const std::string& bind_address,
const std::string& uri = std::string("/metrics"));
const std::string& uri = std::string("/metrics"),
const std::size_t num_threads = 2);
~Exposer();
void RegisterCollectable(const std::weak_ptr<Collectable>& collectable);

Expand Down
6 changes: 4 additions & 2 deletions pull/src/exposer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

namespace prometheus {

Exposer::Exposer(const std::string& bind_address, const std::string& uri)
Exposer::Exposer(const std::string& bind_address, const std::string& uri, const std::size_t num_threads)
: server_(new CivetServer{
{"listening_ports", bind_address.c_str(), "num_threads", "2"}}),
std::vector<std::string>{
"listening_ports", bind_address,
"num_threads", std::to_string(num_threads)}}),
exposer_registry_(std::make_shared<Registry>()),
metrics_handler_(
new detail::MetricsHandler{collectables_, *exposer_registry_}),
Expand Down
2 changes: 1 addition & 1 deletion pull/tests/integration/sample_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int main() {
using namespace prometheus;

// create an http server running on port 8080
Exposer exposer{"127.0.0.1:8080"};
Exposer exposer{"127.0.0.1:8080", "/metrics", 1};

// create a metrics registry with component=main labels applied to all its
// metrics
Expand Down

0 comments on commit 61075ee

Please sign in to comment.