Files
CLIProxyAPI/sdk/api/handlers/handlers_plugin_executor_usage.go
Luis Pater f208c90824 fix(handlers): record TTFT for direct plugin executor routes
- Start TTFT timing before invoking direct plugin executors in both non-streaming and streaming handler paths.
- Record first-packet arrival for non-streaming responses and observe protocol-aware stream chunk TTFT events before publishing usage.

Closes: #7253
2026-11-05 07:21:50 +08:00

19 lines
671 B
Go

package handlers
import (
"github.com/router-for-me/CLIProxyAPI/v8/internal/runtime/executor/helps"
"github.com/router-for-me/CLIProxyAPI/v8/sdk/cliproxy/usage"
)
func parsePluginExecutorResponseUsage(protocol string, payload []byte) usage.Detail {
return helps.ParsePluginExecutorResponseUsage(protocol, payload)
}
func observePluginExecutorStreamUsage(protocol string, payload []byte, buffer *helps.StreamUsageBuffer) {
helps.ObservePluginExecutorStreamUsage(protocol, payload, buffer)
}
func observePluginExecutorStreamTTFT(protocol string, reporter *helps.UsageReporter, payload []byte) {
helps.ObservePluginExecutorStreamTTFT(protocol, reporter, payload)
}