models

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Metrics = metrics{}

Metrics instance of metrics model

View Source
var Report = report{}

Report instance of report model

Functions

This section is empty.

Types

type Profile added in v1.13.0

type Profile struct {
	InstanceID   string      `json:"InstanceId"` // UUID of MySQL instance
	Begin        time.Time   // time range [Begin, End)
	End          time.Time   // time range [Being, End)
	TotalTime    uint        // total seconds in time range minus gaps (missing periods)
	TotalQueries uint        // total unique class queries in time range
	RankBy       RankBy      // criteria for ranking queries compared to global
	Query        []QueryRank // 0=global, 1..N=queries
}

Profile - container for query profile

type QueryLog added in v1.13.0

type QueryLog struct {
	Point        uint      `db:"Point"`
	StartTs      time.Time `db:"Start_ts" json:"Start_ts"`
	NoData       bool
	QueryCount   float32 `db:"Query_count" json:"Query_count"`
	QueryLoad    float32 `db:"Query_load" json:"Query_load"`
	QueryTimeAvg float32 `db:"Query_time_avg" json:"Query_time_avg"`
}

QueryLog - a point of sparkline

type QueryRank added in v1.13.0

type QueryRank struct {
	Rank        uint    // compared to global, same as Profile.Ranks index
	Percentage  float64 // of global value
	ID          string  `json:"Id"` // hex checksum
	Abstract    string  // e.g. SELECT tbl
	Fingerprint string  // e.g. SELECT tbl
	QPS         float64 // ResponseTime.Cnt / Profile.TotalTime
	Load        float64 // Query_time_sum / (Profile.End - Profile.Begin)
	FirstSeen   time.Time
	Log         []QueryLog
	Stats       Stats // this query's Profile.Metric stats
}

QueryRank - represents a row of query profile

type RankBy added in v1.13.0

type RankBy struct {
	Metric string // default: Query_time
	Stat   string // default: sum
	Limit  uint   // default: 10
}

RankBy - a createria of calculating queries with lowest performance.

type Stats added in v1.13.0

type Stats struct {
	Cnt uint64  `db:"query_count"`
	Sum float64 `db:"query_time_sum"`
	Min float64 `db:"query_time_min"`
	P5  float64
	Avg float64 `db:"query_time_avg"`
	Med float64 `db:"query_time_med"`
	P95 float64 `db:"query_time_p95"`
	Max float64 `db:"query_time_max"`
}

Stats - perquery statistics

Jump to

Keyboard shortcuts

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