Merge pull request #3556 from sfc-gh-ljoswiak/visibility-time-format

Fix request tracing time format
This commit is contained in:
Jingyu Zhou 2020-07-23 16:55:35 -07:00 committed by GitHub
commit b37a5037ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,9 @@ struct LogfileTracer : ITracer {
TracerType type() const { return TracerType::LOG_FILE; }
void trace(Span const& span) override {
TraceEvent te(SevInfo, "TracingSpan", span.context);
te.detail("Location", span.location.name).detail("Begin", span.begin).detail("End", span.end);
te.detail("Location", span.location.name)
.detail("Begin", format("%.6f", span.begin))
.detail("End", format("%.6f", span.end));
if (span.parents.size() == 1) {
te.detail("Parent", *span.parents.begin());
} else {
@ -79,6 +81,7 @@ Span& Span::operator=(Span&& o) {
Span::~Span() {
if (begin > 0.0) {
end = g_network->now();
g_tracer->trace(*this);
}
}