Documentation
¶
Index ¶
- func GetEdgeMetricValue(e *EdgeRow, metric string) int64
- func GetEdgePercent(e *EdgeRow, metric string) float64
- func GetFuncMetric(f *FuncStats, metric string) int64
- func SortFunctions(funcs []FuncStats, metric string)
- func SortFunctionsOrder(funcs []FuncStats, metric string, asc bool)
- type Diffs
- type Edge
- type EdgeRow
- type FuncStats
- type IncomingProfile
- type Metrics
- type Module
- func (m *Module) HTTPHandler() module.HTTPIngestionHandler
- func (m *Module) Name() string
- func (m *Module) OnEventStored(ev event.Event)
- func (m *Module) OnInit(db *sql.DB) error
- func (m *Module) PreviewMapper() event.PreviewMapper
- func (m *Module) RegisterMigrations(migrator *storage.Migrator) error
- func (m *Module) RegisterProtectedRoutes(mux *http.ServeMux, protect func(http.Handler) http.Handler)
- func (m *Module) Type() string
- type Percentages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEdgeMetricValue ¶
GetEdgeMetricValue returns the cost value for the given metric on an edge.
func GetEdgePercent ¶
GetEdgePercent returns the percentage value for the given metric on an edge.
func GetFuncMetric ¶
GetFuncMetric returns the value of the specified metric for a function.
func SortFunctions ¶
SortFunctions sorts function stats by the given metric in descending order.
func SortFunctionsOrder ¶ added in v2.14.0
SortFunctionsOrder sorts by metric, ascending when asc; ties by function name, so a cut at a limit is the same on every call.
Types ¶
type Diffs ¶
type Diffs struct {
WallTime int64 `json:"d_wt"`
CPU int64 `json:"d_cpu"`
Memory int64 `json:"d_mu"`
PeakMem int64 `json:"d_pmu"`
Calls int64 `json:"d_ct"`
}
Diffs (exclusive metrics).
type Edge ¶
type Edge struct {
ID string `json:"id"`
Caller *string `json:"caller"`
Callee string `json:"callee"`
Cost Metrics `json:"cost"`
Diff Diffs `json:"diff"`
Percents Percentages `json:"percents"`
Parent *string `json:"parent"`
}
Edge represents a processed caller→callee relationship.
type EdgeRow ¶
type EdgeRow struct {
UUID string
Callee string
Caller *string
ParentUUID *string
Cost Metrics
Diff Diffs
Percents Percentages
}
EdgeRow represents a processed caller→callee relationship from the database.
type FuncStats ¶
type FuncStats struct {
Callee string
Ct, CPU, Wt, Mu, Pmu int64
ExclCPU, ExclWt, ExclMu, ExclPmu, ExclCt int64
PCPU, PWt, PMu, PPmu float64
PExclCPU, PExclWt, PExclMu, PExclPmu float64
}
FuncStats holds aggregated statistics for a function.
func AggregateFunctions ¶
AggregateFunctions aggregates edge data into per-function statistics.
type IncomingProfile ¶
type IncomingProfile struct {
Profile map[string]Metrics `json:"profile"`
AppName string `json:"app_name"`
Hostname string `json:"hostname"`
Date int64 `json:"date"`
Tags map[string]any `json:"tags,omitempty"`
}
IncomingProfile is the raw XHProf payload.
type Metrics ¶
type Metrics struct {
WallTime int64 `json:"wt"`
CPU int64 `json:"cpu"`
Memory int64 `json:"mu"`
PeakMem int64 `json:"pmu"`
Calls int64 `json:"ct"`
}
Metrics holds XHProf metric values.
type Module ¶
type Module struct {
module.BaseModule
// contains filtered or unexported fields
}
func (*Module) HTTPHandler ¶
func (m *Module) HTTPHandler() module.HTTPIngestionHandler
func (*Module) OnEventStored ¶
func (*Module) PreviewMapper ¶
func (m *Module) PreviewMapper() event.PreviewMapper