Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix: update mutation tracer name to mutation->name() (#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverneverer authored Aug 13, 2021
1 parent dca521f commit 6db3165
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/dsn/utils/latency_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ class latency_tracer
// stageA[rpc_message]--stageB[rpc_message]--
void set_sub_tracer(const std::shared_ptr<latency_tracer> &tracer);

void set_name(const std::string &name) { _name = name; }

private:
void dump_trace_points(/*out*/ std::string &traces);

utils::rw_lock_nr _lock;

const std::string _name;
std::string _name;
const uint64_t _threshold;
bool _is_sub;
const uint64_t _start_time;
Expand Down
2 changes: 2 additions & 0 deletions src/replica/replica_2pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ void replica::init_prepare(mutation_ptr &mu, bool reconciliation, bool pop_all_c
mu->set_id(get_ballot(), mu->data.header.decree);
}

mu->tracer->set_name(fmt::format("mutation[{}]", mu->name()));
dlog(level,
"%s: mutation %s init_prepare, mutation_tid=%" PRIu64,
name(),
Expand Down Expand Up @@ -386,6 +387,7 @@ void replica::on_prepare(dsn::message_ex *request)
decree decree = mu->data.header.decree;

dinfo("%s: mutation %s on_prepare", name(), mu->name());
mu->tracer->set_name(fmt::format("mutation[{}]", mu->name()));

dassert(mu->data.header.pid == rconfig.pid,
"(%d.%d) VS (%d.%d)",
Expand Down

0 comments on commit 6db3165

Please sign in to comment.