Files
zeekay 833094dc48 status: the module is hanzo.ai/status
The import path a reader types is the one the org owns, rather than the forge
that happens to host the bytes. hanzo.ai serves the go-import meta and points it
at the same repository, so where the code lives does not change.

Rewritten by role. A bare repository URL — a clone target, a badge, a build
context — still names where the code is and stays on github.com.
2026-08-23 19:48:00 -07:00

27 lines
648 B
Go

package memory
import (
"testing"
"time"
"hanzo.ai/status/config/endpoint"
)
func BenchmarkProcessUptimeAfterResult(b *testing.B) {
uptime := endpoint.NewUptime()
now := time.Now()
now = time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
// Start 12000 days ago
timestamp := now.Add(-12000 * 24 * time.Hour)
for n := 0; n < b.N; n++ {
processUptimeAfterResult(uptime, &endpoint.Result{
Duration: 18 * time.Millisecond,
Success: n%15 == 0,
Timestamp: timestamp,
})
// Simulate an endpoint with an interval of 3 minutes
timestamp = timestamp.Add(3 * time.Minute)
}
b.ReportAllocs()
}