Fix trace event throttling by using different types

This commit is contained in:
Jingyu Zhou 2021-07-31 12:24:59 -07:00
parent 7054bf7054
commit 0a98c76747
1 changed files with 4 additions and 2 deletions

View File

@ -582,7 +582,9 @@ ACTOR Future<Void> decode_logs(DecodeParams params) {
continue; continue;
} }
int i = 0;
for (const auto& m : vms.mutations) { for (const auto& m : vms.mutations) {
i++; // sub sequence number starts at 1
bool print = params.prefix.empty(); // no filtering bool print = params.prefix.empty(); // no filtering
if (!print) { if (!print) {
@ -596,7 +598,7 @@ ACTOR Future<Void> decode_logs(DecodeParams params) {
} }
} }
if (print) { if (print) {
TraceEvent("Mutation") TraceEvent(format("Mutation_%d_%d", vms.version, i).c_str())
.detail("Version", vms.version) .detail("Version", vms.version)
.setMaxFieldLength(10000) .setMaxFieldLength(10000)
.detail("M", m.toString()); .detail("M", m.toString());
@ -652,7 +654,7 @@ int main(int argc, char** argv) {
setupNetwork(0, UseMetrics::True); setupNetwork(0, UseMetrics::True);
TraceEvent::setNetworkThread(); TraceEvent::setNetworkThread();
openTraceFile(NetworkAddress(), 10 << 20, 10 << 20, param.log_dir, "decode", param.trace_log_group); openTraceFile(NetworkAddress(), 10 << 20, 500 << 20, param.log_dir, "decode", param.trace_log_group);
param.tlsConfig.setupBlobCredentials(); param.tlsConfig.setupBlobCredentials();
auto f = stopAfter(decode_logs(param)); auto f = stopAfter(decode_logs(param));