MCPcopy Create free account
hub / github.com/cactus-compute/cactus / parse

Method parse

tests/test_utils.cpp:310–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void Metrics::parse(const std::string& json) {
311 success = json_bool(json, "success", false);
312 error = json_string(json, "error");
313 cloud_handoff = json_bool(json, "cloud_handoff", false);
314 response = json_string(json, "response");
315 thinking = json_string(json, "thinking");
316 function_calls = json_array(json, "function_calls");
317 confidence = json_number(json, "confidence", -1.0);
318 ttft = json_number(json, "time_to_first_token_ms");
319 total_ms = json_number(json, "total_time_ms");
320 prefill_tps = json_number(json, "prefill_tps");
321 decode_tps = json_number(json, "decode_tps");
322 ram_mb = json_number(json, "ram_usage_mb");
323 prefill_tokens = json_number(json, "prefill_tokens");
324 completion_tokens = json_number(json, "decode_tokens");
325 total_tokens = json_number(json, "total_tokens");
326 segments = json_array(json, "segments");
327}
328
329void Metrics::print_json() const {
330 std::cout << " \"success\": " << (success ? "true" : "false") << ",\n"

Callers 13

test_gemma4_vision_audioFunction · 0.80
run_transcription_testFunction · 0.80
run_testFunction · 0.80
test_ragFunction · 0.80
test_streamingFunction · 0.80
test_prefillFunction · 0.80
test_vlm_multiturnFunction · 0.80
test_prefill_with_imagesFunction · 0.80

Calls 4

json_boolFunction · 0.70
json_stringFunction · 0.70
json_arrayFunction · 0.70
json_numberFunction · 0.70

Tested by

no test coverage detected