Documentation ¶
Overview ¶
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Index ¶
- func Execute()
- func SessionStats_printExampleCounter[K comparable](examples []CounterWithExample[K])
- type CounterWithExample
- type OneOrSliceString
- type PgIssueRules
- type QueryStats
- func (s *QueryStats) CountASOK(query string)
- func (s *QueryStats) CountAsKnown(ruleName string, query string)
- func (s *QueryStats) CountAsUnknown(reason string, query string)
- func (s *QueryStats) GetOkCount() int
- func (s *QueryStats) GetOkPercent() float64
- func (s *QueryStats) GetTopKnown(count int) []CounterWithExample[string]
- func (s *QueryStats) GetTopUnknown(count int) []CounterWithExample[string]
- func (s *QueryStats) GetTotalCount() int
- func (s *QueryStats) PrintStats()
- func (s *QueryStats) SaveToFile(path string) error
- type ReplacePair
- type Rules
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func SessionStats_printExampleCounter ¶
func SessionStats_printExampleCounter[K comparable](examples []CounterWithExample[K])
Types ¶
type CounterWithExample ¶
type CounterWithExample[K comparable] struct { ID K `yaml:"id"` Count int `yaml:"count"` Example string `yaml:"example"` }
type OneOrSliceString ¶
type OneOrSliceString []string
func (*OneOrSliceString) Strings ¶
func (s *OneOrSliceString) Strings() []string
func (*OneOrSliceString) UnmarshalYAML ¶
func (s *OneOrSliceString) UnmarshalYAML(value *yaml.Node) error
type PgIssueRules ¶
type PgIssueRules struct { Name string `yaml:"name"` Count int `yaml:"count"` Tag OneOrSliceString `yaml:"tag,omitempty"` IssueLink string `yaml:"issue_link,omitempty"` IssueRegexp OneOrSliceString `yaml:"issue_regexp,omitempty"` QueryRegexp OneOrSliceString `yaml:"query_regexp,omitempty"` Example string `yaml:"example,omitempty"` Comment string `yaml:"comment,omitempty"` Skip bool `yaml:"skip,omitempty"` // skip the issue on check query step PrintIssueToLog bool `yaml:"print_issue_to_log,omitempty"` // contains filtered or unexported fields }
func (*PgIssueRules) Init ¶
func (r *PgIssueRules) Init() error
type QueryStats ¶
type QueryStats struct { MatchToRules map[string]*CounterWithExample[string] // [rule name] query example UnknownProblems map[string]*CounterWithExample[string] // contains filtered or unexported fields }
func (*QueryStats) CountASOK ¶
func (s *QueryStats) CountASOK(query string)
func (*QueryStats) CountAsKnown ¶
func (s *QueryStats) CountAsKnown(ruleName string, query string)
func (*QueryStats) CountAsUnknown ¶
func (s *QueryStats) CountAsUnknown(reason string, query string)
func (*QueryStats) GetOkCount ¶
func (s *QueryStats) GetOkCount() int
func (*QueryStats) GetOkPercent ¶
func (s *QueryStats) GetOkPercent() float64
func (*QueryStats) GetTopKnown ¶
func (s *QueryStats) GetTopKnown(count int) []CounterWithExample[string]
func (*QueryStats) GetTopUnknown ¶
func (s *QueryStats) GetTopUnknown(count int) []CounterWithExample[string]
func (*QueryStats) GetTotalCount ¶
func (s *QueryStats) GetTotalCount() int
func (*QueryStats) PrintStats ¶
func (s *QueryStats) PrintStats()
func (*QueryStats) SaveToFile ¶
func (s *QueryStats) SaveToFile(path string) error
type ReplacePair ¶
type Rules ¶
type Rules struct { TotalStat struct { TotalCount int `yaml:"total_checked_queries,omitempty"` TotalOk int `yaml:"total_ok,omitempty"` OkPercent float64 `yaml:"ok_percent,omitempty"` } `yaml:"stat"` Issues []PgIssueRules }
func (*Rules) LoadFromFile ¶
func (*Rules) MatchToKnownIssues ¶
func (*Rules) UpdateFromStats ¶
func (r *Rules) UpdateFromStats(stats *QueryStats, sortByCount bool)
func (*Rules) WriteToFile ¶
Click to show internal directories.
Click to hide internal directories.