audit

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentSummary

type AgentSummary struct {
	ClawID         string         `json:"claw_id"`
	Requests       int            `json:"requests"`
	Responses      int            `json:"responses"`
	Errors         int            `json:"errors"`
	Interventions  int            `json:"interventions"`
	TokensIn       int            `json:"tokens_in"`
	TokensOut      int            `json:"tokens_out"`
	CostUSD        float64        `json:"cost_usd"`
	ModelUsage     map[string]int `json:"model_usage,omitempty"`
	FirstTimestamp time.Time      `json:"first_timestamp,omitempty"`
	LastTimestamp  time.Time      `json:"last_timestamp,omitempty"`
}

type Event

type Event struct {
	Timestamp          time.Time `json:"timestamp"`
	ClawID             string    `json:"claw_id,omitempty"`
	Type               string    `json:"type"`
	Model              string    `json:"model,omitempty"`
	LatencyMS          *int64    `json:"latency_ms,omitempty"`
	StatusCode         *int      `json:"status_code,omitempty"`
	TokensIn           *int      `json:"tokens_in,omitempty"`
	TokensOut          *int      `json:"tokens_out,omitempty"`
	CostUSD            *float64  `json:"cost_usd,omitempty"`
	InterventionReason string    `json:"intervention_reason,omitempty"`
	Error              string    `json:"error,omitempty"`
	SourceService      string    `json:"source_service,omitempty"`
}

func CollectPodEvents

func CollectPodEvents(ctx context.Context, cli *client.Client, podName string, since time.Time) ([]Event, int, error)

func FilterEvents

func FilterEvents(events []Event, filter Filter) []Event

func NormalizeLine

func NormalizeLine(line []byte) (*Event, error)

func ParseReader

func ParseReader(r io.Reader) ([]Event, int, error)

type Filter

type Filter struct {
	ClawID string
	Type   string
	Since  time.Time
}

type Summary

type Summary struct {
	Agents        []AgentSummary `json:"agents"`
	Requests      int            `json:"requests"`
	Responses     int            `json:"responses"`
	Errors        int            `json:"errors"`
	Interventions int            `json:"interventions"`
	TokensIn      int            `json:"tokens_in"`
	TokensOut     int            `json:"tokens_out"`
	CostUSD       float64        `json:"cost_usd"`
}

func Summarize

func Summarize(events []Event) Summary

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL