MCPcopy Create free account
hub / github.com/apache/impala / Submit

Method Submit

be/src/observe/buffered-span.cc:149–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}// function AddEvent
148
149void BufferedSpan::Submit() {
150 if (span_submitted_ || cancelled_) {
151 VLOG(2) << strings::Substitute("Not submitting span '$0', submitted='$1' "
152 "cancelled='$2'.", name_, span_submitted_, cancelled_);
153 return;
154 }
155
156 VLOG(2) << "Submitting span '" << name_ << "'.";
157
158 if (!span_) {
159 Start();
160 }
161
162 if (!end_time_set_) {
163 RecordEndTimeNow();
164 }
165
166 const int64_t end_time = chrono::duration_cast<chrono::milliseconds>(
167 end_steady_time_.time_since_epoch()).count();
168 const int64_t start_time = chrono::duration_cast<chrono::milliseconds>(
169 start_steady_time_.time_since_epoch()).count();
170
171 span_->SetAttribute("EndTime",
172 static_cast<int64_t>(chrono::duration_cast<chrono::milliseconds>(
173 end_steady_time_.time_since_epoch()).count()));
174 span_->SetAttribute(duration_attribute_name_, (end_time - start_time));
175
176 for (const auto& a : attributes_) {
177 nostd::visit([&](const auto& value) {
178 span_->SetAttribute(a.first, value);
179 }, a.second);
180 }
181
182 AddEventsToSpan();
183
184 trace::EndSpanOptions end_options;
185 end_options.end_steady_time = end_steady_time_;
186 span_->End(end_options);
187 span_submitted_ = true;
188 span_ = nullptr;
189} // function Submit
190
191const trace::SpanContext BufferedSpan::GetContext() const {
192 if (span_) {

Callers 3

~OtelTraceManagerMethod · 0.45
DoTraceQueryMethod · 0.45
EndChildSpanMethod · 0.45

Calls 5

SubstituteFunction · 0.85
visitFunction · 0.85
countMethod · 0.45
SetAttributeMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected