Documentation ¶
Index ¶
Constants ¶
View Source
const K000_EXCESS_QUERY_TOTAL_TIME string = "K000_EXCESS_QUERY_TOTAL_TIME"
View Source
const MAX_QUERY_TOTAL_TIME float64 = 30 // Percents from all workload during the analyzed period
View Source
const MSG_EXCESS_QUERY_TOTAL_TIME_CONCLUSION string = "[P1] For some query groups, `total_time` > %.2f%% of overall timing, observed on: %s. " +
"Such a high percentage means that those queries are \"major contributors\" to resource consumption on those nodes. In other words, " +
"if a query group has `total_time` which is %.2f%% of overall timing, it means that during the observation period, %.2f%% of time CPUs were " +
"working on that node processing queries from this group.\n"
View Source
const MSG_EXCESS_QUERY_TOTAL_TIME_RECOMMENDATION string = "[P1] For some query groups, `total_time` > %.2f%% of overall timing. To reduce `total_time` " +
"for particular query group consider the following tactics: \n" +
" - perform query micro-optimization (take particular query examples related to the group, use `EXPLAIN` and `EXPLAIN (BUFFERS, " +
"ANALYZE)` to optimize it; consider using [Joe](https://gitlab.com/postgres-ai/joe) to boost the optimization process);\n" +
" - if the frequency of execution is high (check the `calls / second` metric), try to find a way to reduce the frequency, changing the " +
"application code and/or, if applicable, applying caching.\n"
View Source
const MSG_NODE string = "node: %s"
View Source
const MSG_NODES string = "nodes: %s"
Variables ¶
This section is empty.
Functions ¶
func K000PreprocessReportData ¶
func K000PreprocessReportData(data map[string]interface{})
func K000Process ¶
func K000Process(report K000Report) (checkup.ReportResult, error)
Types ¶
type K000HostData ¶
type K000HostData struct { StartTimestamptz string `json:"start_timestamptz"` EndTimestamptz string `json:"end_timestamptz"` PeriodSeconds float64 `json:"period_seconds"` PeriodAge string `json:"period_age"` AbsoluteErrorCalls float64 `json:"absolute_error_calls"` AbsoluteErrorTotalTime float64 `json:"absolute_error_total_time"` RelativeErrorCalls float64 `json:"relative_error_calls"` RelativeErrorTotalTime float64 `json:"relative_error_total_time"` Queries map[string]K00Query `json:"queries"` Aggregated map[string]K00Query `json:"aggregated"` WorkloadType map[string]K00Query `json:"workload_type"` }
type K000Report ¶
type K000Report struct { Project string `json:"project"` Name string `json:"name"` CheckId string `json:"checkId"` Timestamptz string `json:"timestamptz"` Database string `json:"database"` Dependencies map[string]interface{} `json:"dependencies"` LastNodesJson checkup.ReportLastNodes `json:"last_nodes_json"` Results K000ReportHostsResults `json:"results"` }
type K000ReportHostResult ¶
type K000ReportHostResult struct { Data K000HostData `json:"data"` NodesJson checkup.ReportLastNodes `json:"nodes.json"` }
type K000ReportHostsResults ¶
type K000ReportHostsResults map[string]K000ReportHostResult
type K00Query ¶
type K00Query struct { RowNum int64 `json:"rownum"` DiffCalls float64 `json:"diff_calls"` PerSecCalls float64 `json:"per_sec_calls"` PerCallCalls float64 `json:"per_call_calls"` RatioCalls float64 `json:"ratio_calls"` DiffTotalTime float64 `json:"diff_total_time"` PerSecTotalTime float64 `json:"per_sec_total_time"` PerCallTotalTime float64 `json:"per_call_total_time"` RatioTotalTime float64 `json:"ratio_total_time"` DiffRows float64 `json:"diff_rows"` PerSecRows float64 `json:"per_sec_rows"` PerCallRows float64 `json:"per_call_rows"` RatioRows float64 `json:"ratio_rows"` DiffLocalBlksHit float64 `json:"diff_local_blks_hit"` PerSecLocalBlksHit float64 `json:"per_sec_local_blks_hit"` PerCallLocalBlksHit float64 `json:"per_call_local_blks_hit"` RatioLocalBlksHit float64 `json:"ratio_local_blks_hit"` DiffLocalBlksRead float64 `json:"diff_local_blks_read"` PerSecLocalBlksRead float64 `json:"per_sec_local_blks_read"` PerCallLocalBlksRead float64 `json:"per_call_local_blks_read"` RatioLocalBlksRead float64 `json:"ratio_local_blks_read"` DiffLocalBlksDirtied float64 `json:"diff_local_blks_dirtied"` PerSecLocalBlksDirtied float64 `json:"per_sec_local_blks_dirtied"` PerCallLocalBlksDirtied float64 `json:"per_call_local_blks_dirtied"` RatioLocalBlksDirtied float64 `json:"ratio_local_blks_dirtied"` DiffLocalBlksWritten float64 `json:"diff_local_blks_written"` PerSecLocalBlksWritten float64 `json:"per_sec_local_blks_written"` PerCallLocalBlksWritten float64 `json:"per_call_local_blks_written"` RatioLocalBlksWritten float64 `json:"ratio_local_blks_written"` DiffTempBlksRead float64 `json:"diff_temp_blks_read"` PerSecTempBlksRead float64 `json:"per_sec_temp_blks_read"` PerCallTempBlksRead float64 `json:"per_call_temp_blks_read"` RatioTempBlksRead float64 `json:"ratio_temp_blks_read"` DiffTempBlksWritten float64 `json:"diff_temp_blks_written"` PerSecTempBlksWritten float64 `json:"per_sec_temp_blks_written"` PerCallTempBlksWritten float64 `json:"per_call_temp_blks_written"` RatioTempBlksWritten float64 `json:"ratio_temp_blks_written"` DiffBlkReadTime float64 `json:"diff_blk_read_time"` PerSecBlkReadTime float64 `json:"per_sec_blk_read_time"` PerCallBlkReadTime float64 `json:"per_call_blk_read_time"` RatioBlkReadTime float64 `json:"ratio_blk_read_time"` DiffBlkWriteTime float64 `json:"diff_blk_write_time"` PerSecBlkWriteTime float64 `json:"per_sec_blk_write_time"` PerCallBlkWriteTime float64 `json:"per_call_blk_write_time"` RatioBlkWriteTime float64 `json:"ratio_blk_write_time"` DiffKcacheReads float64 `json:"diff_kcache_reads"` PerSecKcacheReads float64 `json:"per_sec_kcache_reads"` PerCallKcacheReads float64 `json:"per_call_kcache_reads"` RatioKcacheReads float64 `json:"ratio_kcache_reads"` DiffKcacheWrites float64 `json:"diff_kcache_writes"` PerSecKcacheWrites float64 `json:"per_sec_kcache_writes"` PerCallKcacheWrites float64 `json:"per_call_kcache_writes"` RatioKcacheWrites float64 `json:"ratio_kcache_writes"` DiffKcacheUserTimeMs float64 `json:"diff_kcache_user_time_ms"` PerSecKcacheUserTimeMs float64 `json:"per_sec_kcache_user_time_ms"` PerCallKcacheUserTimeMs float64 `json:"per_call_kcache_user_time_ms"` RatioKcacheUserTimeMs float64 `json:"ratio_kcache_user_time_ms"` DiffKcacheSystemTimeMs float64 `json:"diff_kcache_system_time_ms"` PerSecKcacheSystemTimeMs float64 `json:"per_sec_kcache_system_time_ms"` PerCallKcacheSystemTimeMs float64 `json:"per_call_kcache_system_time_ms"` RatioKcacheSystemTimeMs float64 `json:"ratio_kcache_system_time_ms"` Md5 string `json:"md5"` Queryid string `json:"queryid"` Query string `json:"query"` Link string `json:"link"` ReadableQueryid string `json:"readable_queryid"` }
Click to show internal directories.
Click to hide internal directories.