mirror of
https://github.com/hanzoai/agent.git
synced 2026-09-11 21:08:51 +00:00
Consolidate all Hanzo agent infrastructure into one repo: - control-plane/: Go control plane server (was agents-new) - sdk/: Go, Python, TypeScript SDKs - deployments/: Docker, Kubernetes, Helm configs - Dockerfile.sdk: Python SDK image (ghcr.io/hanzoai/agent:latest) - CI builds both SDK + control-plane images No more agentfield — everything is hanzoai/agent.
29 lines
801 B
Go
29 lines
801 B
Go
package services
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/testutil"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestRecordQueueDepthClampsNegative(t *testing.T) {
|
|
recordQueueDepth(-10)
|
|
require.Equal(t, float64(0), testutil.ToFloat64(queueDepthGauge))
|
|
}
|
|
|
|
func TestRecordWaiterCountClampsNegative(t *testing.T) {
|
|
recordWaiterCount(-5)
|
|
require.Equal(t, float64(0), testutil.ToFloat64(waiterInflightGauge))
|
|
}
|
|
|
|
func TestNormalizeAgentLabel(t *testing.T) {
|
|
require.Equal(t, "worker", normalizeAgentLabel(" worker "))
|
|
require.Equal(t, "unknown", normalizeAgentLabel(""))
|
|
}
|
|
|
|
func TestRecordGatewayBackpressure(t *testing.T) {
|
|
RecordGatewayBackpressure("Queue_Full")
|
|
require.Equal(t, float64(1), testutil.ToFloat64(backpressureCounter.WithLabelValues("queue_full")))
|
|
}
|