if (!sampling_result.IsRecording())
{ // create no-op span with valid span-context.
auto noop_span = nostd::shared_ptr<opentelemetry::trace::Span>{ new (std::nothrow)
opentelemetry::trace::NoopSpan(this->shared_from_this(), std::move(span_context))}; return noop_span;
} else
{
auto span = nostd::shared_ptr<opentelemetry::trace::Span>{ new (std::nothrow) Span{this->shared_from_this(), name, attributes, links, options,
parent_context, std::move(span_context)}};
// if the attributes is not nullptr, add attributes to the span. if (sampling_result.attributes)
{ for (auto &kv : *sampling_result.attributes)
{
span->SetAttribute(kv.first, kv.second);
}
}
void Tracer::CloseWithMicroseconds(uint64_t timeout) noexcept
{ // Trace context is shared by many tracers.So we just call ForceFlush to flush all pending spans // and do not shutdown it. if (context_)
{
context_->ForceFlush(
std::chrono::microseconds{static_cast<std::chrono::microseconds::rep>(timeout)});
}
}
} // namespace trace
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.