Documentation
¶
Index ¶
Constants ¶
View Source
const (
MaxIngestPartialLineBytes = 512 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IngestState ¶
type IngestState struct {
SourcePath string
Offset int64
FileSize int64
FileModTime time.Time
PartialLine string
PartialLineBytes int
PartialLineOversized bool
UpdatedAt time.Time
}
IngestState stores the persistent cursor for a tailed JSONL file.
type UsageEvent ¶
type UsageEvent struct {
Timestamp time.Time
Integration string
Provider string
Account string
Model string
RequestID string
PromptTokens int
CompletionTokens int
TotalTokens int
CostUSD *float64
LatencyMS *int
MetadataJSON string
SourcePath string
Fingerprint string
}
UsageEvent is the normalized API integration telemetry event stored by onWatch.
func ParseUsageEventLine ¶
func ParseUsageEventLine(line []byte, sourcePath string) (*UsageEvent, error)
ParseUsageEventLine validates and normalizes a single JSONL event line.
Click to show internal directories.
Click to hide internal directories.