diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ddeedcd01..9e6179091 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,7 +66,7 @@ set(MG_SINGLE_NODE_LIBS stdc++fs Threads::Threads fmt cppitertools antlr_opencypher_parser_lib dl glog gflags mg-utils mg-io mg-requests mg-communication) # These are enterprise subsystems -set(MG_SINGLE_NODE_LIBS ${MG_SINGLE_NODE_LIBS} mg-integrations-kafka mg-auth mg-stats) +set(MG_SINGLE_NODE_LIBS ${MG_SINGLE_NODE_LIBS} mg-integrations-kafka mg-auth) if (USE_LTALLOC) list(APPEND MG_SINGLE_NODE_LIBS ltalloc) @@ -236,7 +236,7 @@ add_custom_target(generate_capnp DEPENDS generate_lcp_distributed ${generated_ca set(MG_DISTRIBUTED_LIBS stdc++fs Threads::Threads fmt cppitertools antlr_opencypher_parser_lib dl glog gflags capnp kj mg-utils mg-io mg-io-serialization mg-integrations-kafka mg-requests - mg-communication mg-comm-rpc mg-auth mg-stats) + mg-communication mg-comm-rpc mg-auth) # STATIC library used by memgraph executables add_library(mg-distributed STATIC ${mg_distributed_sources}) @@ -325,7 +325,7 @@ add_custom_target(generate_capnp_single_node_ha DEPENDS generate_lcp_single_node set(MG_SINGLE_NODE_HA_LIBS stdc++fs Threads::Threads fmt cppitertools antlr_opencypher_parser_lib dl glog gflags capnp kj mg-utils mg-io mg-integrations-kafka mg-requests mg-communication mg-comm-rpc - mg-auth mg-stats) + mg-auth) if (USE_LTALLOC) list(APPEND MG_SINGLE_NODE_HA_LIBS ltalloc) diff --git a/src/memgraph.cpp b/src/memgraph.cpp index 1ba593812..e8c4c2d39 100644 --- a/src/memgraph.cpp +++ b/src/memgraph.cpp @@ -105,5 +105,5 @@ void SingleNodeMain() { } int main(int argc, char **argv) { - return WithInit(argc, argv, []() { return "memgraph"; }, SingleNodeMain); + return WithInit(argc, argv, SingleNodeMain); } diff --git a/src/memgraph_distributed.cpp b/src/memgraph_distributed.cpp index 15e9e82b3..c182c9d98 100644 --- a/src/memgraph_distributed.cpp +++ b/src/memgraph_distributed.cpp @@ -136,15 +136,6 @@ void WorkerMain() { } int main(int argc, char **argv) { - auto get_stats_prefix = [&]() -> std::string { - if (FLAGS_master) { - return "master"; - } else if (FLAGS_worker) { - return fmt::format("worker-{}", FLAGS_worker_id); - } - return "memgraph"; - }; - auto memgraph_main = [&]() { CHECK(!(FLAGS_master && FLAGS_worker)) << "Can't run Memgraph as worker and master at the same time!"; @@ -156,5 +147,5 @@ int main(int argc, char **argv) { WorkerMain(); }; - return WithInit(argc, argv, get_stats_prefix, memgraph_main); + return WithInit(argc, argv, memgraph_main); } diff --git a/src/memgraph_ha.cpp b/src/memgraph_ha.cpp index 958912a9c..14064ab53 100644 --- a/src/memgraph_ha.cpp +++ b/src/memgraph_ha.cpp @@ -90,5 +90,5 @@ void SingleNodeHAMain() { } int main(int argc, char **argv) { - return WithInit(argc, argv, []() { return "memgraph"; }, SingleNodeHAMain); + return WithInit(argc, argv, SingleNodeHAMain); } diff --git a/src/memgraph_init.cpp b/src/memgraph_init.cpp index 3b9a59ef9..e75aecd62 100644 --- a/src/memgraph_init.cpp +++ b/src/memgraph_init.cpp @@ -7,7 +7,6 @@ #include "glue/communication.hpp" #include "query/exceptions.hpp" #include "requests/requests.hpp" -#include "stats/stats.hpp" #include "utils/signals.hpp" #include "utils/sysinfo/memory.hpp" #include "utils/terminate_handler.hpp" @@ -159,7 +158,6 @@ void InitSignalHandlers(const std::function &shutdown_fun) { } int WithInit(int argc, char **argv, - const std::function &get_stats_prefix, const std::function &memgraph_main) { gflags::SetVersionString(version_string); @@ -175,9 +173,6 @@ int WithInit(int argc, char **argv, // Unhandled exception handler init. std::set_terminate(&utils::TerminateHandler); - stats::InitStatsLogging(get_stats_prefix()); - utils::OnScopeExit stop_stats([] { stats::StopStatsLogging(); }); - // Initialize the communication library. communication::Init(); diff --git a/src/memgraph_init.hpp b/src/memgraph_init.hpp index d7032f5e8..36fed15ec 100644 --- a/src/memgraph_init.hpp +++ b/src/memgraph_init.hpp @@ -91,8 +91,7 @@ void InitSignalHandlers(const std::function &shutdown_fun); /// Run the Memgraph server. /// /// Sets up all the required state before running `memgraph_main` and does any -/// required cleanup afterwards. `get_stats_prefix` is used to obtain the -/// prefix when logging Memgraph's statistics. +/// required cleanup afterwards. /// /// Command line arguments and configuration files are read before calling any /// of the supplied functions. Therefore, you should use flags only from those @@ -104,8 +103,7 @@ void InitSignalHandlers(const std::function &shutdown_fun); /// /// @code /// int main(int argc, char *argv[]) { -/// auto get_stats_prefix = []() -> std::string { return "memgraph"; }; -/// return WithInit(argc, argv, get_stats_prefix, SingleNodeMain); +/// return WithInit(argc, argv, SingleNodeMain); /// } /// @endcode /// @@ -114,5 +112,4 @@ void InitSignalHandlers(const std::function &shutdown_fun); /// `InitSignalHandlers` with appropriate function to shutdown the server you /// started. int WithInit(int argc, char **argv, - const std::function &get_stats_prefix, const std::function &memgraph_main); diff --git a/src/storage/distributed/storage_gc.hpp b/src/storage/distributed/storage_gc.hpp index 629639b54..e7d21e6c6 100644 --- a/src/storage/distributed/storage_gc.hpp +++ b/src/storage/distributed/storage_gc.hpp @@ -5,7 +5,6 @@ #include "data_structures/concurrent/concurrent_map.hpp" #include "storage/distributed/mvcc/version_list.hpp" -#include "stats/metrics.hpp" #include "storage/distributed/deferred_deleter.hpp" #include "storage/distributed/edge.hpp" #include "storage/distributed/garbage_collector.hpp" diff --git a/src/storage/single_node/storage_gc.hpp b/src/storage/single_node/storage_gc.hpp index 45aad8b68..0678aba0a 100644 --- a/src/storage/single_node/storage_gc.hpp +++ b/src/storage/single_node/storage_gc.hpp @@ -5,7 +5,6 @@ #include "data_structures/concurrent/concurrent_map.hpp" #include "storage/single_node/mvcc/version_list.hpp" -#include "stats/metrics.hpp" #include "storage/single_node/deferred_deleter.hpp" #include "storage/single_node/edge.hpp" #include "storage/single_node/garbage_collector.hpp" diff --git a/src/storage/single_node_ha/storage_gc.hpp b/src/storage/single_node_ha/storage_gc.hpp index 44c4cc370..195a214b7 100644 --- a/src/storage/single_node_ha/storage_gc.hpp +++ b/src/storage/single_node_ha/storage_gc.hpp @@ -5,7 +5,6 @@ #include "data_structures/concurrent/concurrent_map.hpp" #include "raft/raft_server.hpp" -#include "stats/metrics.hpp" #include "storage/single_node_ha/deferred_deleter.hpp" #include "storage/single_node_ha/edge.hpp" #include "storage/single_node_ha/garbage_collector.hpp" diff --git a/tests/feature_benchmark/kafka/benchmark.cpp b/tests/feature_benchmark/kafka/benchmark.cpp index 237d18738..8e206369f 100644 --- a/tests/feature_benchmark/kafka/benchmark.cpp +++ b/tests/feature_benchmark/kafka/benchmark.cpp @@ -104,5 +104,5 @@ void KafkaBenchmarkMain() { } int main(int argc, char **argv) { - return WithInit(argc, argv, []() { return "memgraph"; }, KafkaBenchmarkMain); + return WithInit(argc, argv, KafkaBenchmarkMain); } diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 07026c20e..a6e420ca9 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -144,7 +144,7 @@ add_unit_test(kvstore.cpp) target_link_libraries(${test_prefix}kvstore kvstore_lib glog) add_unit_test(metrics.cpp) -target_link_libraries(${test_prefix}metrics mg-single-node kvstore_dummy_lib) +target_link_libraries(${test_prefix}metrics mg-stats) add_unit_test(mvcc.cpp) target_link_libraries(${test_prefix}mvcc mg-single-node kvstore_dummy_lib)