Register MapBuilderServer metrics (#1133)
I am not adding these registration calls to `cartographer/metrics/register.cc` because they are specific to cloud based mapping.master
parent
913b1b5856
commit
e080df5ea3
|
@ -6,6 +6,10 @@
|
||||||
namespace cartographer {
|
namespace cartographer {
|
||||||
namespace cloud {
|
namespace cloud {
|
||||||
|
|
||||||
|
void RegisterMapBuilderServerMetrics(metrics::FamilyFactory* factory) {
|
||||||
|
MapBuilderServer::RegisterMetrics(factory);
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<MapBuilderServerInterface> CreateMapBuilderServer(
|
std::unique_ptr<MapBuilderServerInterface> CreateMapBuilderServer(
|
||||||
const proto::MapBuilderServerOptions& map_builder_server_options,
|
const proto::MapBuilderServerOptions& map_builder_server_options,
|
||||||
std::unique_ptr<mapping::MapBuilderInterface> map_builder) {
|
std::unique_ptr<mapping::MapBuilderInterface> map_builder) {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "cartographer/cloud/proto/map_builder_server_options.pb.h"
|
#include "cartographer/cloud/proto/map_builder_server_options.pb.h"
|
||||||
#include "cartographer/mapping/map_builder_interface.h"
|
#include "cartographer/mapping/map_builder_interface.h"
|
||||||
|
#include "cartographer/metrics/family_factory.h"
|
||||||
|
|
||||||
namespace cartographer {
|
namespace cartographer {
|
||||||
namespace cloud {
|
namespace cloud {
|
||||||
|
@ -45,6 +46,9 @@ class MapBuilderServerInterface {
|
||||||
virtual void Shutdown() = 0;
|
virtual void Shutdown() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Registers all metrics for the MapBuilderServer.
|
||||||
|
void RegisterMapBuilderServerMetrics(metrics::FamilyFactory* factory);
|
||||||
|
|
||||||
// Returns MapBuilderServer with the actual implementation.
|
// Returns MapBuilderServer with the actual implementation.
|
||||||
std::unique_ptr<MapBuilderServerInterface> CreateMapBuilderServer(
|
std::unique_ptr<MapBuilderServerInterface> CreateMapBuilderServer(
|
||||||
const proto::MapBuilderServerOptions& map_builder_server_options,
|
const proto::MapBuilderServerOptions& map_builder_server_options,
|
||||||
|
|
|
@ -41,6 +41,7 @@ void Run(const std::string& configuration_directory,
|
||||||
#if USE_PROMETHEUS
|
#if USE_PROMETHEUS
|
||||||
metrics::prometheus::FamilyFactory registry;
|
metrics::prometheus::FamilyFactory registry;
|
||||||
::cartographer::metrics::RegisterAllMetrics(®istry);
|
::cartographer::metrics::RegisterAllMetrics(®istry);
|
||||||
|
RegisterMapBuilderServerMetrics(®istry);
|
||||||
::prometheus::Exposer exposer("0.0.0.0:9100");
|
::prometheus::Exposer exposer("0.0.0.0:9100");
|
||||||
exposer.RegisterCollectable(registry.GetCollectable());
|
exposer.RegisterCollectable(registry.GetCollectable());
|
||||||
LOG(INFO) << "Exposing metrics at http://localhost:9100/metrics";
|
LOG(INFO) << "Exposing metrics at http://localhost:9100/metrics";
|
||||||
|
|
Loading…
Reference in New Issue