query

package
v0.0.0-...-1f1d885 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultQuery

type DefaultQuery struct {
	// contains filtered or unexported fields
}

func NewDefaultQuery

func NewDefaultQuery(vmselectHandler http.HandlerFunc, documentDB *genji.DB) *DefaultQuery

func (*DefaultQuery) Close

func (dq *DefaultQuery) Close()

func (*DefaultQuery) Instances

func (dq *DefaultQuery) Instances(startSecs, endSecs int, fill *[]InstanceItem) error

func (*DefaultQuery) Records

func (dq *DefaultQuery) Records(name string, startSecs, endSecs, windowSecs, top int, instance, instanceType string, fill *[]RecordItem) error

func (*DefaultQuery) Summary

func (dq *DefaultQuery) Summary(startSecs, endSecs, windowSecs, top int, instance, instanceType string, fill *[]SummaryItem) error

type InstanceItem

type InstanceItem struct {
	Instance     string `json:"instance"`
	InstanceType string `json:"instance_type"`
}

type Query

type Query interface {
	Records(name string, startSecs, endSecs, windowSecs, top int, instance, instanceType string, fill *[]RecordItem) error
	Summary(startSecs, endSecs, windowSecs, top int, instance, instanceType string, fill *[]SummaryItem) error
	Instances(startSecs, endSecs int, fill *[]InstanceItem) error
	Close()
}

type RecordItem

type RecordItem struct {
	SQLDigest string           `json:"sql_digest"`
	SQLText   string           `json:"sql_text"`
	IsOther   bool             `json:"is_other"`
	Plans     []RecordPlanItem `json:"plans"`
}

type RecordKey

type RecordKey struct {
	SQLDigest  string
	PlanDigest string
}

type RecordPlanItem

type RecordPlanItem struct {
	PlanDigest       string   `json:"plan_digest"`
	PlanText         string   `json:"plan_text"`
	TimestampSec     []uint64 `json:"timestamp_sec"`
	CPUTimeMs        []uint64 `json:"cpu_time_ms,omitempty"`
	ReadRows         []uint64 `json:"read_rows,omitempty"`
	ReadIndexes      []uint64 `json:"read_indexes,omitempty"`
	WriteRows        []uint64 `json:"write_rows,omitempty"`
	WriteIndexes     []uint64 `json:"write_indexes,omitempty"`
	SQLExecCount     []uint64 `json:"sql_exec_count,omitempty"`
	SQLDurationSum   []uint64 `json:"sql_duration_sum,omitempty"`
	SQLDurationCount []uint64 `json:"sql_duration_count,omitempty"`
}

type SummaryItem

type SummaryItem struct {
	SQLDigest         string            `json:"sql_digest"`
	SQLText           string            `json:"sql_text"`
	IsOther           bool              `json:"is_other"`
	CPUTimeMs         uint64            `json:"cpu_time_ms"`
	ExecCountPerSec   float64           `json:"exec_count_per_sec"`
	DurationPerExecMs float64           `json:"duration_per_exec_ms"`
	ScanRecordsPerSec float64           `json:"scan_records_per_sec"`
	ScanIndexesPerSec float64           `json:"scan_indexes_per_sec"`
	Plans             []SummaryPlanItem `json:"plans"`
}

type SummaryPlanItem

type SummaryPlanItem struct {
	PlanDigest        string   `json:"plan_digest"`
	PlanText          string   `json:"plan_text"`
	TimestampSec      []uint64 `json:"timestamp_sec"`
	CPUTimeMs         []uint64 `json:"cpu_time_ms,omitempty"`
	ExecCountPerSec   float64  `json:"exec_count_per_sec"`
	DurationPerExecMs float64  `json:"duration_per_exec_ms"`
	ScanRecordsPerSec float64  `json:"scan_records_per_sec"`
	ScanIndexesPerSec float64  `json:"scan_indexes_per_sec"`
}

type TopKSlice

type TopKSlice []sqlGroup

func (TopKSlice) Len

func (s TopKSlice) Len() int

func (TopKSlice) Less

func (s TopKSlice) Less(i, j int) bool

func (TopKSlice) Swap

func (s TopKSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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