Documentation
¶
Index ¶
- type AddQueryRequest
- type JIT
- type Options
- type Plan
- type Planning
- type Query
- type QueryPlan
- type QueryPlans
- type Querychecker
- func (q *Querychecker) AddQuery(ctx context.Context, name, query string, checkEvery time.Duration)
- func (q *Querychecker) CheckQueryPlan(ctx context.Context, query string) (*QueryPlan, error)
- func (q *Querychecker) GetQueries(ctx context.Context) []*Query
- func (q *Querychecker) GetQuery(ctx context.Context, name string) *Query
- func (q *Querychecker) HandleAddQuery(c echo.Context) error
- func (q *Querychecker) HandleDeleteQuery(c echo.Context) error
- func (q *Querychecker) HandleGetQueries(c echo.Context) error
- func (q *Querychecker) HandleGetQuery(c echo.Context) error
- func (q *Querychecker) HandleUpdateQuery(c echo.Context) error
- func (q *Querychecker) RemoveQuery(ctx context.Context, name string)
- func (q *Querychecker) Start() error
- func (q *Querychecker) Stop()
- func (q *Querychecker) UpdateQuery(ctx context.Context, name, query string, checkEvery time.Duration)
- type RetQuery
- type Timing
- type UpdateQueryRequest
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddQueryRequest ¶
type Plan ¶
type Plan struct {
NodeType string `json:"Node Type"`
ParallelAware bool `json:"Parallel Aware"`
AsyncCapable bool `json:"Async Capable"`
StartupCost float64 `json:"Startup Cost"`
TotalCost float64 `json:"Total Cost"`
PlanRows int `json:"Plan Rows"`
PlanWidth int `json:"Plan Width"`
ActualStartupTime float64 `json:"Actual Startup Time"`
ActualTotalTime float64 `json:"Actual Total Time"`
ActualRows int `json:"Actual Rows"`
ActualLoops int `json:"Actual Loops"`
Output []string `json:"Output"`
LocalHitBlocks int `json:"Local Hit Blocks"`
LocalReadBlocks int `json:"Local Read Blocks"`
LocalDirtiedBlocks int `json:"Local Dirtied Blocks"`
LocalWrittenBlocks int `json:"Local Written Blocks"`
TempReadBlocks int `json:"Temp Read Blocks"`
TempWrittenBlocks int `json:"Temp Written Blocks"`
IOReadTime float64 `json:"I/O Read Time"`
IOWriteTime float64 `json:"I/O Write Time"`
Plans []Plan `json:"Plans,omitempty"`
ParentRelationship string `json:"Parent Relationship,omitempty"`
SortKey []string `json:"Sort Key,omitempty"`
SortMethod string `json:"Sort Method,omitempty"`
SortSpaceUsed int `json:"Sort Space Used,omitempty"`
SortSpaceType string `json:"Sort Space Type,omitempty"`
WorkersPlanned int `json:"Workers Planned,omitempty"`
WorkersLaunched int `json:"Workers Launched,omitempty"`
SingleCopy bool `json:"Single Copy,omitempty"`
RelationName string `json:"Relation Name,omitempty"`
Schema string `json:"Schema,omitempty"`
Alias string `json:"Alias,omitempty"`
Filter string `json:"Filter,omitempty"`
RowsRemovedByFilter int `json:"Rows Removed by Filter,omitempty"`
Workers []Worker `json:"Workers,omitempty"`
}
func (*Plan) HasSameStructureAs ¶
type Planning ¶
type Planning struct {
LocalHitBlocks int `json:"Local Hit Blocks"`
LocalReadBlocks int `json:"Local Read Blocks"`
LocalDirtiedBlocks int `json:"Local Dirtied Blocks"`
LocalWrittenBlocks int `json:"Local Written Blocks"`
TempReadBlocks int `json:"Temp Read Blocks"`
TempWrittenBlocks int `json:"Temp Written Blocks"`
IOReadTime float64 `json:"I/O Read Time"`
IOWriteTime float64 `json:"I/O Write Time"`
}
type Query ¶
type Query struct {
Name string
Query string
LatestPlan *QueryPlan
PreviousPlan *QueryPlan
LastChecked time.Time
LastError error
CheckEvery time.Duration
// contains filtered or unexported fields
}
Query is a query to check
func (*Query) RecordPlanMetrics ¶
RecordPlanMetrics records the query plan metrics
func (*Query) RecordPlanNode ¶
RecordPlanNode records the query plan node metrics
type QueryPlan ¶
type QueryPlan struct {
Plan Plan `json:"Plan"`
QueryIdentifier int64 `json:"Query Identifier"`
Planning Planning `json:"Planning"`
PlanningTime float64 `json:"Planning Time"`
Triggers []string `json:"Triggers"`
JIT JIT `json:"JIT"`
ExecutionTime float64 `json:"Execution Time"`
}
func (*QueryPlan) HasSameStructureAs ¶
type QueryPlans ¶
type QueryPlans []QueryPlan
type Querychecker ¶
type Querychecker struct {
Queries []*Query
Logger *slog.Logger
// contains filtered or unexported fields
}
Querychecker is a query checker meta object
func NewQuerychecker ¶
func NewQuerychecker(ctx context.Context, connectionURL string) (*Querychecker, error)
NewQuerychecker creates a new querychecker
func (*Querychecker) CheckQueryPlan ¶
CheckQueryPlan checks the query plan for a given query
func (*Querychecker) GetQueries ¶
func (q *Querychecker) GetQueries(ctx context.Context) []*Query
GetQueries returns a copy of the queries
func (*Querychecker) GetQuery ¶
func (q *Querychecker) GetQuery(ctx context.Context, name string) *Query
GetQuery returns a copy of the query
func (*Querychecker) HandleAddQuery ¶
func (q *Querychecker) HandleAddQuery(c echo.Context) error
func (*Querychecker) HandleDeleteQuery ¶
func (q *Querychecker) HandleDeleteQuery(c echo.Context) error
func (*Querychecker) HandleGetQueries ¶
func (q *Querychecker) HandleGetQueries(c echo.Context) error
func (*Querychecker) HandleGetQuery ¶
func (q *Querychecker) HandleGetQuery(c echo.Context) error
func (*Querychecker) HandleUpdateQuery ¶
func (q *Querychecker) HandleUpdateQuery(c echo.Context) error
func (*Querychecker) RemoveQuery ¶
func (q *Querychecker) RemoveQuery(ctx context.Context, name string)
RemoveQuery removes a query from the checker
func (*Querychecker) Start ¶
func (q *Querychecker) Start() error
Start starts the query checker routines
func (*Querychecker) UpdateQuery ¶
func (q *Querychecker) UpdateQuery(ctx context.Context, name, query string, checkEvery time.Duration)
UpdateQuery updates a query
type UpdateQueryRequest ¶
type Worker ¶
type Worker struct {
WorkerNumber int `json:"Worker Number"`
ActualStartupTime float64 `json:"Actual Startup Time"`
ActualTotalTime float64 `json:"Actual Total Time"`
ActualRows int `json:"Actual Rows"`
ActualLoops int `json:"Actual Loops"`
JIT JIT `json:"JIT"`
LocalHitBlocks int `json:"Local Hit Blocks"`
LocalReadBlocks int `json:"Local Read Blocks"`
LocalDirtiedBlocks int `json:"Local Dirtied Blocks"`
LocalWrittenBlocks int `json:"Local Written Blocks"`
TempReadBlocks int `json:"Temp Read Blocks"`
TempWrittenBlocks int `json:"Temp Written Blocks"`
IOReadTime float64 `json:"I/O Read Time"`
IOWriteTime float64 `json:"I/O Write Time"`
}
Click to show internal directories.
Click to hide internal directories.