21 #include "gflags/gflags.h" 22 #include "glog/logging.h" 25 #include "prometheus/exposer.h" 29 "First directory in which configuration files are searched, " 30 "second is always the Cartographer installation to allow " 31 "including files from there.");
33 "Basename, i.e. not containing any directory prefix, of the " 34 "configuration file.");
39 void Run(
const std::string& configuration_directory,
40 const std::string& configuration_basename) {
45 ::prometheus::Exposer exposer(
"0.0.0.0:9100");
47 LOG(INFO) <<
"Exposing metrics at http://localhost:9100/metrics";
50 proto::MapBuilderServerOptions map_builder_server_options =
52 configuration_basename);
55 map_builder_server_options.mutable_map_builder_options()
56 ->set_collate_by_trajectory(
true);
57 auto map_builder = common::make_unique<mapping::MapBuilder>(
58 map_builder_server_options.map_builder_options());
59 std::unique_ptr<MapBuilderServerInterface> map_builder_server =
61 std::move(map_builder));
62 map_builder_server->Start();
63 map_builder_server->WaitForShutdown();
69 int main(
int argc,
char** argv) {
70 google::InitGoogleLogging(argv[0]);
71 FLAGS_logtostderr =
true;
72 google::SetUsageMessage(
74 "This program offers a MapBuilder service via a gRPC interface.\n");
75 google::ParseCommandLineFlags(&argc, &argv,
true);
76 if (FLAGS_configuration_directory.empty() ||
77 FLAGS_configuration_basename.empty()) {
78 google::ShowUsageWithFlagsRestrict(argv[0],
"cloud_server");
82 FLAGS_configuration_basename);
std::weak_ptr<::prometheus::Collectable > GetCollectable() const
int main(int argc, char **argv)
void RegisterMapBuilderServerMetrics(metrics::FamilyFactory *factory)
DEFINE_string(configuration_directory, "", "First directory in which configuration files are searched, " "second is always the Cartographer installation to allow " "including files from there.")
std::unique_ptr< MapBuilderServerInterface > CreateMapBuilderServer(const proto::MapBuilderServerOptions &map_builder_server_options, std::unique_ptr< mapping::MapBuilderInterface > map_builder)
void RegisterAllMetrics(FamilyFactory *registry)
proto::MapBuilderServerOptions LoadMapBuilderServerOptions(const std::string &configuration_directory, const std::string &configuration_basename)
void Run(const std::string &configuration_directory, const std::string &configuration_basename)