fix(metrics): 补齐媒体结果存储读取与兼容响应指标

增加对象存储 GET、结果 URL 签名和同步 Base64 限流指标,使生产轮询可直接验证零对象下载,并区分签名失败、容量等待超时和 20MiB 超限。\n\n验证:API 全量 go test、go vet、gofmt 与 git diff --check。
This commit is contained in:
2026-08-05 18:55:41 +08:00
parent b13392ef50
commit 03c0873649
7 changed files with 113 additions and 7 deletions
@@ -2,6 +2,7 @@ package runner
import (
"context"
"fmt"
"io"
"net/http"
"net/http/httptest"
@@ -371,10 +372,16 @@ func TestObjectStorageReadUsesChannelRetryPolicy(t *testing.T) {
if err != nil {
t.Fatal(err)
}
payload, err := readObjectStorageWithRetries(t.Context(), adapter, "media/request_asset/object.png")
var observed []string
payload, err := readObjectStorageWithRetriesObserved(t.Context(), adapter, "media/request_asset/object.png", func(event string, provider string, bytes int, _ time.Duration) {
observed = append(observed, fmt.Sprintf("%s:%s:%d", event, provider, bytes))
})
if err != nil || string(payload) != "stored-payload" || calls.Load() != 2 {
t.Fatalf("payload=%q calls=%d err=%v", payload, calls.Load(), err)
}
if got := strings.Join(observed, ","); got != "read_failure:s3:0,read_success:s3:14" {
t.Fatalf("observed=%s", got)
}
}
func TestObjectStorageAuthFailureSkipsSameChannelRetry(t *testing.T) {