Documentation
¶
Index ¶
- Constants
- func ReadWindowColumns(ctx context.Context) ([]string, bool)
- func RecordCoverage(ctx context.Context, fresh time.Time)
- func WithInventoryWindow(ctx context.Context, window Window) context.Context
- func WithReadProfile(ctx context.Context, p *ReadProfile) context.Context
- func WithWindow(ctx context.Context, window Window) context.Context
- func WithWindowColumns(ctx context.Context, columns []string) context.Context
- type Coverage
- type Queryer
- type ReadKind
- type ReadProfile
- type ReadTransactioner
- type Rows
- type SQLAdapter
- type SQLQueryer
- type Window
Constants ¶
const CompletedTraceLimit = 21
CompletedTraceLimit is the deepest ranking CompletedTraceQuery answers exactly; the read cache keeps enough spans per partition for this depth.
const CompletedTraceQuery = `` /* 352-byte string literal not displayed */
CompletedTraceQuery ranks scoped traces by their best in-window span: an error first, then the longest span, then trace_id and namespace. Arguments are start, end, namespace twice, service twice, and a limit of at most CompletedTraceLimit. Results are namespace, trace_id, and whether the trace has an in-scope, in-window error span.
Variables ¶
This section is empty.
Functions ¶
func WithInventoryWindow ¶
WithInventoryWindow records the logical panel interval before file lookback expansion. It is independent of the raw-file read window and read kind.
func WithReadProfile ¶
func WithReadProfile(ctx context.Context, p *ReadProfile) context.Context
func WithWindowColumns ¶
WithWindowColumns records the exact columns a trusted SQL panel bounds with the read window, captured at macro expansion where each column is unambiguous. A raw signal is event-time pruned by the window only when one of these columns is that signal's own event-time clock; a window on any other column (or on another relation joined to it) binds every captured file for the signal instead of silently dropping rows. Absent entirely, every raw signal keeps its default clock-based pruning.
Types ¶
type Coverage ¶
type Coverage struct {
// contains filtered or unexported fields
}
Coverage carries the oldest incomplete ingest horizon back from snapshot binding to the panel result. Comparisons and auxiliary reads share the value.
type ReadKind ¶
type ReadKind uint8
ReadKind identifies private aggregate relations used by trusted dashboard SQL.
type ReadProfile ¶
type ReadProfile struct {
Wait, Bind, Execute time.Duration
// Cached batches rank from read_trace_exemplars; tail batches and their
// spans are read raw, filtered when Pruned.
CachedBatches, TailBatches, TailSpans int
Pruned bool
}
ReadProfile carries one read's phase times, and for a trace ranking its source's shape, back to the caller's slow-request log. A context holds it for a single QueryContext call.
func ReadProfileFrom ¶
func ReadProfileFrom(ctx context.Context) *ReadProfile
ReadProfileFrom returns the context's profile, or nil.
type ReadTransactioner ¶
type ReadTransactioner interface {
WithReadTransaction(context.Context, func(Queryer) error) error
}
ReadTransactioner runs related reads on one connection and database snapshot.
type Rows ¶
type Rows interface {
Close() error
Columns() ([]string, error)
Err() error
Next() bool
Scan(dest ...any) error
}
Rows is the database row-stream surface used by query consumers. Keeping it as an interface lets storage engines attach resource-lifetime behavior (for example, retaining a Parquet snapshot lock until iteration is complete).
type SQLAdapter ¶
type SQLAdapter struct{ DB SQLQueryer }
func (SQLAdapter) QueryContext ¶
func (SQLAdapter) WithReadTransaction ¶
type SQLQueryer ¶
type SQLQueryer interface {
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
}
SQLQueryer is implemented by *sql.DB and sqlmock's database handle.
type Window ¶
type Window struct {
Start, End time.Time
Namespace, Service string
Kind ReadKind
// RetainedInventory is exact retained-service membership, including uncached
// files. It ignores event time only for resource_inventory; raw relations
// still require the caller's explicit event-time predicates.
RetainedInventory bool
}
Window is an explicit internal read scope. Only callers that apply these event-time predicates may use it to exclude immutable Parquet files.