Documentation
¶
Index ¶
- type CleanConfig
- type Store
- func (s *Store) CleanEvery(ctx context.Context, freq time.Duration, cfg CleanConfig)
- func (s *Store) Clear(ctx context.Context, appID string) error
- func (s *Store) DoClean(ctx context.Context, cfg CleanConfig) error
- func (s *Store) Get(ctx context.Context, appID, traceID string, iter trace2.EventIterator) error
- func (s *Store) GetEvents(ctx context.Context, appID, traceID, spanID string) ([]*tracepb2.TraceEvent, error)
- func (s *Store) GetSpanSummaries(ctx context.Context, appID, traceID string) ([]*tracepb2.SpanSummary, error)
- func (s *Store) List(ctx context.Context, q *trace2.Query, iter trace2.ListEntryIterator) error
- func (s *Store) Listen(ch chan<- trace2.NewSpanEvent)
- func (s *Store) WriteEvents(ctx context.Context, meta *trace2.Meta, events []*tracepbcli.TraceEvent) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanConfig ¶ added in v1.58.6
type CleanConfig struct {
// MaxBytesPerApp is one app's budget.
MaxBytesPerApp int64
// MaxBytesTotal bounds every app together, so the ceiling does not grow with
// the number of apps on the machine. Zero disables it.
MaxBytesTotal int64
// MinTracesKept is how many of an app's newest traces survive whatever their size.
MinTracesKept int
// BatchSize caps how many traces one sweep deletes per app.
BatchSize int
// KnownApps reports the apps the daemon still knows about, under every id
// their traces may be recorded as. Traces belonging to any other app are
// dropped. Nil, an error, or an empty result skips the prune.
KnownApps func() ([]string, error)
}
CleanConfig bounds how much trace data the daemon keeps on disk. Sizes are measured over trace_event alone; it holds the payloads and dominates.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CleanEvery ¶ added in v1.50.2
func (*Store) DoClean ¶ added in v1.50.2
func (s *Store) DoClean(ctx context.Context, cfg CleanConfig) error
DoClean drops traces the daemon no longer needs: those of apps it has forgotten, then each app's oldest until it fits MaxBytesPerApp, then whole apps oldest-first until everything fits MaxBytesTotal. Deleted pages go to SQLite's freelist, so this bounds where the file settles, it does not shrink it.
func (*Store) GetSpanSummaries ¶ added in v1.54.0
func (*Store) Listen ¶
func (s *Store) Listen(ch chan<- trace2.NewSpanEvent)
func (*Store) WriteEvents ¶
func (s *Store) WriteEvents(ctx context.Context, meta *trace2.Meta, events []*tracepbcli.TraceEvent) error
Click to show internal directories.
Click to hide internal directories.