Documentation
¶
Index ¶
- type ContextProvider
- type Options
- type ProfileStoreProvider
- type Runner
- type RunnerOptions
- type Service
- type Store
- func (s *Store) BindResolver(resolve func(id string) (*query.Session, bool))
- func (s *Store) Close() error
- func (s *Store) Events(ctx context.Context, id string) ([]query.Event, error)
- func (s *Store) Flush() error
- func (s *Store) Get(ctx context.Context, id string) (query.SessionInfo, bool, error)
- func (s *Store) List(ctx context.Context) ([]query.SessionInfo, error)
- func (s *Store) MarkInterrupted(ctx context.Context) error
- func (s *Store) OnEvent(e query.Event)
- func (s *Store) OnTransition(info query.SessionInfo)
- func (s *Store) Prune(ctx context.Context) error
- type TopOptions
- type TraceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextProvider ¶
type Options ¶
type Options struct {
Profiles ProfileStoreProvider
Context ContextProvider
Registry *query.SessionRegistry
Store *Store
}
type ProfileStoreProvider ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(options RunnerOptions) (*Runner, error)
type RunnerOptions ¶
type RunnerOptions struct {
Profiles ProfileStoreProvider
Context ContextProvider
Stdout io.Writer
Stderr io.Writer
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the durable record of trace/top sessions: its OnTransition and OnEvent methods plug into query.RegistryOptions, upserting session state and batch-writing events. Live streaming always serves from memory; the DB answers after the session left the registry (restart, pruning).
func (*Store) BindResolver ¶
BindResolver wires the live-session lookup used to fail sessions whose events cannot be persisted.
func (*Store) Flush ¶
Flush writes all buffered events, joining any errors (including flush failures recorded for sessions with no live handle).
func (*Store) MarkInterrupted ¶
MarkInterrupted finalizes sessions orphaned by a restart: their streams are gone, so rows still starting/running become interrupted.
func (*Store) OnEvent ¶
OnEvent buffers the event, flushing synchronously once a full batch has accumulated; it matches query.RegistryOptions.OnEvent.
func (*Store) OnTransition ¶
func (s *Store) OnTransition(info query.SessionInfo)
OnTransition upserts the session row; it matches query.RegistryOptions.OnTransition.