trace.go
TEXT FILE424 B · Public source code for developers, search crawlers and AI agents
1package stage2
2
3import (
4 "crypto/rand"
5 "encoding/hex"
6 "time"
7)
8
9type Trace struct {
10 ID string `json:"id"`
11 Started time.Time `json:"started"`
12 EngineMS int64 `json:"engine_ms"`
13 AIMS int64 `json:"ai_ms"`
14}
15
16func NewTrace() (Trace, error) {
17 b := make([]byte, 12)
18 if _, e := rand.Read(b); e != nil {
19 return Trace{}, e
20 }
21 return Trace{ID: hex.EncodeToString(b), Started: time.Now().UTC()}, nil
22}Read-only source · Select a line number to link directly · Raw download above
