Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion bench/adapters/SpdlogAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class SpdlogAdapter::MeasuringSink : public spdlog::sinks::sink {
{
std::lock_guard<std::mutex> lock(m_pending_mx);
m_pending.clear();
m_retired.clear();
}
if (m_sink == SinkKind::File) {
std::filesystem::create_directories("bench/results");
Expand Down Expand Up @@ -82,11 +83,20 @@ class SpdlogAdapter::MeasuringSink : public spdlog::sinks::sink {
std::lock_guard<std::mutex> lock(m_pending_mx);
pending.swap(m_pending);
}
for (const auto& entry : pending) {

std::vector<std::unique_ptr<MessagePayload>> retired;
retired.reserve(pending.size());
for (auto& entry : pending) {
if (entry.token.active && m_recorder) {
m_recorder->complete(entry.token);
}
if (entry.payload) {
retired.push_back(std::move(entry.payload));
}
}
m_retired.insert(m_retired.end(),
std::make_move_iterator(retired.begin()),
std::make_move_iterator(retired.end()));
}

private:
Expand Down Expand Up @@ -125,6 +135,8 @@ class SpdlogAdapter::MeasuringSink : public spdlog::sinks::sink {
LatencyRecorder::Token token;
};
std::vector<Pending> m_pending;
std::vector<std::unique_ptr<MessagePayload>> m_retired;

std::mutex m_pending_mx;
};

Expand Down
1 change: 0 additions & 1 deletion bench/logit_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ ScenarioResult execute_scenario(
recorder->wait_for_all();
const auto sum = recorder->finalize();


double thr = 0.0;
if (dur.count() > 0) {
const double sec = static_cast<double>(dur.count()) / 1'000'000'000.0;
Expand Down