Remove stats to mitigate lock contention

Reviewers: mtomic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1271
This commit is contained in:
Matej Ferencevic 2018-03-05 10:40:43 +01:00
parent 36eed4743a
commit 41f3b75709
3 changed files with 2 additions and 26 deletions
src
communication/rpc
database

View File

@ -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<Message, Res>::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<Message> response = nullptr;
stats::Stopwatch(request_name, [&] {
response = Call(Req(std::forward<Args>(args)...));
});
std::unique_ptr<Message> response = Call(Req(std::forward<Args>(args)...));
auto *real_response = dynamic_cast<Res *>(response.get());
if (!real_response && response) {
// Since message_id was checked in private Call function, this means

View File

@ -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<Message> response = nullptr;
stats::Stopwatch(request_name,
[&] { response = it->second(*(request.get())); });
std::unique_ptr<Message> response = it->second(*(request.get()));
if (!response) {
throw SessionException("Trying to send nullptr instead of message");

View File

@ -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();
}