MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / end

Method end

src/langfuse/tracer.cpp:505–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505bool Trace::end() {
506 if (ended_.exchange(true))
507 return true;
508
509 JsonValue batch = JsonValue::array();
510 {
511 std::lock_guard<std::mutex> lock(mu_);
512 batch.push_back(build_trace_event());
513 for (auto& ev : events_)
514 batch.push_back(std::move(ev));
515 events_.clear();
516 }
517
518 bool ok = tracer_.send_batch(batch);
519 return ok ||
520 tracer_.config().error_policy == Config::ErrorPolicy::kBestEffort;
521}
522
523std::string Trace::to_iso8601(std::chrono::system_clock::time_point t) {
524 auto tt = std::chrono::system_clock::to_time_t(t);

Callers 15

supports_modelMethod · 0.45
build_request_jsonMethod · 0.45
build_request_jsonMethod · 0.45
supports_modelMethod · 0.45
TEST_PFunction · 0.45
supports_modelMethod · 0.45
supports_modelMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
lookup_userFunction · 0.45

Calls 1

send_batchMethod · 0.80

Tested by 1

TEST_PFunction · 0.36