ci

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Problem

type Problem struct {
	Kind  ProblemKind
	Query string
	Count int
	// AvgDuration is set only for ProblemSlowQuery.
	AvgDuration time.Duration
}

Problem describes a single detected issue.

type ProblemKind

type ProblemKind string

ProblemKind categorizes a detected issue.

const (
	ProblemNPlus1    ProblemKind = "N+1"
	ProblemSlowQuery ProblemKind = "SLOW"
)

type Result

type Result struct {
	TotalQueries int
	Problems     []Problem
}

Result holds the CI run outcome.

func Aggregate

func Aggregate(events []*tapv1.QueryEvent) Result

Aggregate computes the CI result from the given events. Intended for testing; the streaming path uses aggregator directly.

func Run

func Run(ctx context.Context, addr string) (Result, error)

Run connects to the gRPC server at addr, collects query events until ctx is cancelled or the server closes the stream, and returns the aggregated result.

func (Result) HasProblems

func (r Result) HasProblems() bool

HasProblems reports whether any issues were detected.

func (Result) Report

func (r Result) Report() string

Report formats the result as a human-readable string.

Jump to

Keyboard shortcuts

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