This commit is contained in:
Marko Budiselic 2023-03-26 16:14:59 +02:00
parent 9b42d4f4f8
commit ebb7b9c61d
4 changed files with 10 additions and 5 deletions

View File

@ -1,16 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)

View File

@ -1,4 +1,4 @@
// Copyright 2022 Memgraph Ltd.
// Copyright 2023 Memgraph Ltd.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
@ -22,6 +22,7 @@
#include "io/message_histogram_collector.hpp"
#include "io/time.hpp"
#include "io/transport.hpp"
#include "utils/timer.hpp"
namespace memgraph::io::local_transport {
@ -108,6 +109,7 @@ class LocalTransportHandle {
auto type_info = TypeInfoFor(message);
std::any message_any(std::forward<M>(message));
MG_RAII_TIMER(timer, message_any.type().name());
OpaqueMessage opaque_message{.to_address = to_address,
.from_address = from_address,
.request_id = request_id,

View File

@ -48,6 +48,7 @@
#include "storage/v3/vertex_id.hpp"
#include "storage/v3/view.hpp"
#include "utils/logging.hpp"
#include "utils/timer.hpp"
namespace memgraph::storage::v3 {
using msgs::Label;
@ -516,6 +517,7 @@ msgs::WriteResponses ShardRsm::ApplyWrite(msgs::CommitRequest &&req) {
};
msgs::ReadResponses ShardRsm::HandleRead(msgs::GetPropertiesRequest &&req) {
MG_RAII_TIMER(timer, "SHARD_RSM_HANDLE_GET_PROPS");
if (!req.vertex_ids.empty() && !req.vertices_and_edges.empty()) {
auto shard_error = SHARD_ERROR(ErrorCode::NONEXISTENT_OBJECT);
auto error = CreateErrorResponse(shard_error, req.transaction_id, "");

View File

@ -12,6 +12,7 @@
#pragma once
#include <chrono>
#include <functional>
namespace memgraph::utils {
@ -51,6 +52,6 @@ class Timer {
// some of them ON/OFF (not all).
//
#define MG_RAII_TIMER(name, message) \
memgraph::utils::Timer<> name([](auto elapsed) { spdlog::critical("{} {}s", message, elapsed); })
memgraph::utils::Timer<> name([&](auto elapsed) { spdlog::critical("{} {}s", message, elapsed); })
} // namespace memgraph::utils