| 455 | out << "[REQUEST_BODY_SKIPPED] multipart_file" |
| 456 | << " field=" << json_quote(part.name) |
| 457 | << " filename=" << json_quote(part.filename) |
| 458 | << " bytes=" << part.data.size(); |
| 459 | engine::debug::log_message(out.str()); |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | double elapsed_ms(Clock::time_point started) { |
| 464 | return std::chrono::duration<double, std::milli>(Clock::now() - started).count(); |
| 465 | } |
| 466 | |
| 467 | double audio_duration_ms(const engine::runtime::AudioBuffer & audio) { |
| 468 | if (audio.sample_rate <= 0 || audio.channels <= 0) { |
| 469 | return 0.0; |
| 470 | } |
| 471 | return 1000.0 * static_cast<double>(audio.samples.size()) / |
| 472 | static_cast<double>(audio.sample_rate * audio.channels); |
| 473 | } |
| 474 | |
| 475 | double audio_rtf(double wall_ms, double duration_ms) { |
| 476 | return duration_ms > 0.0 ? wall_ms / duration_ms : 0.0; |
| 477 | } |
| 478 | |
| 479 | std::string timing_json(double wall_ms) { |
| 480 | std::ostringstream out; |
| 481 | out << "{\"wall_ms\":" << wall_ms << "}"; |
| 482 | return out.str(); |
| 483 | } |
| 484 | |
| 485 | std::string timing_json(double wall_ms, const engine::runtime::AudioBuffer & audio) { |
| 486 | const double duration_ms = audio_duration_ms(audio); |
| 487 | std::ostringstream out; |
| 488 | out << "{\"wall_ms\":" << wall_ms |
nothing calls this directly
no test coverage detected