feat(storage): 统一二进制对象存储与公开错误
新增 Aliyun OSS 与 S3 协议、通道内重试和按优先级跨通道切换,保留 server-main 兼容与环境 OSS 内存通道。 将请求及结果中的 Base64、Data URI、Buffer、multipart 和内联二进制统一对象化,生产路径不再写入本机静态目录,历史本地资源仅保留只读兼容。 引入 PublicErrorV1 并统一 API、异步查询、兼容协议和失败回调的安全错误输出,同时补充迁移、管理端、指标、OpenAPI 与本地模拟验收。 验证:go test ./... -count=1;go vet ./...;pnpm lint;pnpm test;pnpm build;pnpm openapi;tests/ci/migrations-test.sh。
This commit is contained in:
@@ -52,6 +52,11 @@ func TestMetricsExposeBoundedOutcomesAndState(t *testing.T) {
|
||||
metrics.ObserveCandidateRouting("cooldown_skipped")
|
||||
metrics.ObserveCandidateRouting("disabled_skipped")
|
||||
metrics.ObserveCandidateRouting("all_full_queued")
|
||||
metrics.ObserveObjectStorage("write_success", "aliyun_oss", 128, 25*time.Millisecond)
|
||||
metrics.ObserveObjectStorage("write_failure", "s3", 0, 10*time.Millisecond)
|
||||
metrics.ObserveObjectStorage("retry", "s3", 0, 0)
|
||||
metrics.ObserveObjectStorage("failover", "s3", 0, 0)
|
||||
metrics.ObserveObjectStorage("all_failed", "", 0, 0)
|
||||
metrics.ObserveAsyncWorkerResize("success")
|
||||
metrics.ObserveConcurrencyLeaseRenewal("success")
|
||||
metrics.ObserveConcurrencyLeaseRenewal("lost")
|
||||
@@ -98,6 +103,13 @@ func TestMetricsExposeBoundedOutcomesAndState(t *testing.T) {
|
||||
`easyai_gateway_candidate_routing_total{outcome="cooldown_skipped"} 1`,
|
||||
`easyai_gateway_candidate_routing_total{outcome="disabled_skipped"} 1`,
|
||||
`easyai_gateway_candidate_routing_total{outcome="all_full_queued"} 1`,
|
||||
`easyai_gateway_storage_write_attempts_total{protocol="aliyun_oss"} 1`,
|
||||
`easyai_gateway_storage_write_failures_total{protocol="s3"} 1`,
|
||||
`easyai_gateway_storage_write_duration_seconds_total{protocol="aliyun_oss"} 0.025000`,
|
||||
`easyai_gateway_storage_channel_retries_total 1`,
|
||||
`easyai_gateway_storage_channel_failovers_total 1`,
|
||||
`easyai_gateway_storage_all_channels_failed_total 1`,
|
||||
`easyai_gateway_storage_objectified_bytes_total 128`,
|
||||
`easyai_gateway_platform_model_rate_limit_utilization{platform_model_id="platform-model-1",metric="concurrent"} 0.750000`,
|
||||
`easyai_gateway_async_worker_resizes_total{outcome="success"} 1`,
|
||||
`easyai_gateway_concurrency_lease_renewals_total{outcome="success"} 1`,
|
||||
|
||||
Reference in New Issue
Block a user