feat(go): expose gateway frame duration histogram

This commit is contained in:
lingniu
2026-07-03 18:54:00 +08:00
parent 71905aca3d
commit 16ee09180c
10 changed files with 182 additions and 9 deletions

View File

@@ -82,6 +82,9 @@ func TestTCPServerRecordsFrameMetrics(t *testing.T) {
`vehicle_gateway_identity_total{protocol="JT808",status="unresolved"} 1`,
`vehicle_gateway_publish_total{kind="raw",protocol="JT808",status="ok"} 1`,
`vehicle_gateway_frame_duration_ms{protocol="JT808",status="OK"}`,
`vehicle_gateway_frame_duration_ms_histogram_bucket{le="+Inf",protocol="JT808",status="OK"} 1`,
`vehicle_gateway_frame_duration_ms_histogram_count{protocol="JT808",status="OK"} 1`,
`vehicle_gateway_frame_duration_ms_histogram_sum{protocol="JT808",status="OK"}`,
} {
if !strings.Contains(text, want) {
t.Fatalf("metrics missing %s:\n%s", want, text)