From 41f3b7570994ece0238a2b43545dd614b93c8902 Mon Sep 17 00:00:00 2001 From: Matej Ferencevic Date: Mon, 5 Mar 2018 10:40:43 +0100 Subject: [PATCH] Remove stats to mitigate lock contention Reviewers: mtomic Reviewed By: mtomic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1271 --- src/communication/rpc/client.hpp | 10 +--------- src/communication/rpc/protocol.cpp | 10 +--------- src/database/storage_gc.hpp | 8 -------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/communication/rpc/client.hpp b/src/communication/rpc/client.hpp index 579b0dedc..f11411aca 100644 --- a/src/communication/rpc/client.hpp +++ b/src/communication/rpc/client.hpp @@ -11,8 +11,6 @@ #include "communication/rpc/messages.hpp" #include "io/network/endpoint.hpp" #include "io/network/socket.hpp" -#include "stats/metrics.hpp" -#include "utils/demangle.hpp" namespace communication::rpc { @@ -31,13 +29,7 @@ class Client { "TRequestResponse::Request must be derived from Message"); static_assert(std::is_base_of::value, "TRequestResponse::Response must be derived from Message"); - std::string request_name = - fmt::format("rpc.client.{}", - utils::Demangle(typeid(Req).name()).value_or("unknown")); - std::unique_ptr response = nullptr; - stats::Stopwatch(request_name, [&] { - response = Call(Req(std::forward(args)...)); - }); + std::unique_ptr response = Call(Req(std::forward(args)...)); auto *real_response = dynamic_cast(response.get()); if (!real_response && response) { // Since message_id was checked in private Call function, this means diff --git a/src/communication/rpc/protocol.cpp b/src/communication/rpc/protocol.cpp index 9b20d83ba..4e167507f 100644 --- a/src/communication/rpc/protocol.cpp +++ b/src/communication/rpc/protocol.cpp @@ -9,8 +9,6 @@ #include "communication/rpc/messages.hpp" #include "communication/rpc/protocol.hpp" #include "communication/rpc/server.hpp" -#include "stats/metrics.hpp" -#include "utils/demangle.hpp" namespace communication::rpc { @@ -46,13 +44,7 @@ void Session::Execute() { "Session trying to execute an unregistered RPC call!"); } - auto request_name = fmt::format( - "rpc.server.{}", - utils::Demangle(request->type_index().name()).value_or("unknown")); - std::unique_ptr response = nullptr; - - stats::Stopwatch(request_name, - [&] { response = it->second(*(request.get())); }); + std::unique_ptr response = it->second(*(request.get())); if (!response) { throw SessionException("Trying to send nullptr instead of message"); diff --git a/src/database/storage_gc.hpp b/src/database/storage_gc.hpp index 95009556f..852791d45 100644 --- a/src/database/storage_gc.hpp +++ b/src/database/storage_gc.hpp @@ -16,12 +16,6 @@ namespace database { -namespace { - -stats::Gauge &gc_running = stats::GetGauge("storage.garbage_collection", 0); - -} // namespace - /** Garbage collection capabilities for database::Storage. Extracted into a * separate class for better code organization, and because the GC requires a * tx::Engine, while the Storage itself can exist without it. Even though, a @@ -78,10 +72,8 @@ class StorageGc { // This can be run concurrently utils::Timer x; - gc_running.Set(1); vertices_.gc_.Run(snapshot, tx_engine_); edges_.gc_.Run(snapshot, tx_engine_); - gc_running.Set(0); VLOG(1) << "Garbage collector mvcc phase time: " << x.Elapsed().count(); }