Documentation
¶
Index ¶
Constants ¶
const SortKeyCount = 4
SortKeyCount is the number of available sort keys.
Variables ¶
This section is empty.
Functions ¶
func NormalizeSQL ¶
NormalizeSQL replaces literals in a SQL query with ? placeholders, compresses IN lists, and normalizes whitespace.
func Percentile ¶
Percentile returns the value at the given percentile from a sorted slice of durations using the nearest-rank (ceiling) method. pct must be in [0, 1]. The slice must be sorted in ascending order; passing an unsorted slice yields undefined results.
Types ¶
type EndpointStat ¶
EndpointStat holds aggregated statistics for an HTTP endpoint.
func SortEndpoints ¶
func SortEndpoints(stats []EndpointStat, key SortKey) []EndpointStat
SortEndpoints returns a new slice sorted by the given key (descending).
type FuncStat ¶
FuncStat holds aggregated statistics for a function.
func SortFunctions ¶
SortFunctions returns a new slice sorted by the given key (descending).
type MatchingGroups ¶
type MatchingGroups struct {
// contains filtered or unexported fields
}
MatchingGroups groups URIs using regex patterns, like alp's --matching-groups. The first matching pattern's string becomes the group key.
func NewMatchingGroups ¶
func NewMatchingGroups(patterns []string) (*MatchingGroups, error)
NewMatchingGroups compiles pattern strings into a MatchingGroups. Each pattern must be a valid regular expression. Patterns are automatically anchored with ^ and $ if not already present.
func (*MatchingGroups) Match ¶
func (mg *MatchingGroups) Match(uri string) string
Match returns the first matching pattern string for the given URI. If no pattern matches, the original URI is returned unchanged.
type N1Detection ¶
N1Detection represents a potential N+1 query pattern.
type Report ¶
type Report struct {
TraceCount int
Endpoints []EndpointStat
SQL []SQLStat
Functions []FuncStat
N1 []N1Detection
}
Report contains the full analytics result.