mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
all: make fmt
via the upcoming Go1.19
This commit is contained in:
parent
8851cf68e1
commit
5c8eee26bf
12 changed files with 43 additions and 40 deletions
|
@ -63,6 +63,7 @@ type Config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// StaticConfig contains list of static targets in the following form:
|
// StaticConfig contains list of static targets in the following form:
|
||||||
|
//
|
||||||
// targets:
|
// targets:
|
||||||
// [ - '<host>' ]
|
// [ - '<host>' ]
|
||||||
type StaticConfig struct {
|
type StaticConfig struct {
|
||||||
|
|
|
@ -74,9 +74,10 @@ var (
|
||||||
|
|
||||||
// Init returns a function for retrieving actual list of Notifier objects.
|
// Init returns a function for retrieving actual list of Notifier objects.
|
||||||
// Init works in two mods:
|
// Init works in two mods:
|
||||||
// * configuration via flags (for backward compatibility). Is always static
|
// - configuration via flags (for backward compatibility). Is always static
|
||||||
// and don't support live reloads.
|
// and don't support live reloads.
|
||||||
// * configuration via file. Supports live reloads and service discovery.
|
// - configuration via file. Supports live reloads and service discovery.
|
||||||
|
//
|
||||||
// Init returns an error if both mods are used.
|
// Init returns an error if both mods are used.
|
||||||
func Init(gen AlertURLGenerator, extLabels map[string]string, extURL string) (func() []Notifier, error) {
|
func Init(gen AlertURLGenerator, extLabels map[string]string, extURL string) (func() []Notifier, error) {
|
||||||
if externalLabels != nil || externalURL != "" {
|
if externalLabels != nil || externalURL != "" {
|
||||||
|
|
|
@ -1036,7 +1036,6 @@ func (cp *commonParams) IsDefaultTimeRange() bool {
|
||||||
// - match[]
|
// - match[]
|
||||||
// - extra_label
|
// - extra_label
|
||||||
// - extra_filters[]
|
// - extra_filters[]
|
||||||
//
|
|
||||||
func getExportParams(r *http.Request, startTime time.Time) (*commonParams, error) {
|
func getExportParams(r *http.Request, startTime time.Time) (*commonParams, error) {
|
||||||
cp, err := getCommonParams(r, startTime, true)
|
cp, err := getCommonParams(r, startTime, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1054,7 +1053,6 @@ func getExportParams(r *http.Request, startTime time.Time) (*commonParams, error
|
||||||
// - match[]
|
// - match[]
|
||||||
// - extra_label
|
// - extra_label
|
||||||
// - extra_filters[]
|
// - extra_filters[]
|
||||||
//
|
|
||||||
func getCommonParams(r *http.Request, startTime time.Time, requireNonEmptyMatch bool) (*commonParams, error) {
|
func getCommonParams(r *http.Request, startTime time.Time, requireNonEmptyMatch bool) (*commonParams, error) {
|
||||||
deadline := searchutils.GetDeadlineForQuery(r, startTime)
|
deadline := searchutils.GetDeadlineForQuery(r, startTime)
|
||||||
start, err := searchutils.GetTime(r, "start", 0)
|
start, err := searchutils.GetTime(r, "start", 0)
|
||||||
|
|
|
@ -219,8 +219,11 @@ func (d *Deadline) String() string {
|
||||||
//
|
//
|
||||||
// Label filters can be present in extra_label and extra_filters[] query args.
|
// Label filters can be present in extra_label and extra_filters[] query args.
|
||||||
// They are combined. For example, the following query args:
|
// They are combined. For example, the following query args:
|
||||||
|
//
|
||||||
// extra_label=t1=v1&extra_label=t2=v2&extra_filters[]={env="prod",team="devops"}&extra_filters={env=~"dev|staging",team!="devops"}
|
// extra_label=t1=v1&extra_label=t2=v2&extra_filters[]={env="prod",team="devops"}&extra_filters={env=~"dev|staging",team!="devops"}
|
||||||
|
//
|
||||||
// should be translated to the following filters joined with "or":
|
// should be translated to the following filters joined with "or":
|
||||||
|
//
|
||||||
// {env="prod",team="devops",t1="v1",t2="v2"}
|
// {env="prod",team="devops",t1="v1",t2="v2"}
|
||||||
// {env=~"dev|staging",team!="devops",t1="v1",t2="v2"}
|
// {env=~"dev|staging",team!="devops",t1="v1",t2="v2"}
|
||||||
func GetExtraTagFilters(r *http.Request) ([][]storage.TagFilter, error) {
|
func GetExtraTagFilters(r *http.Request) ([][]storage.TagFilter, error) {
|
||||||
|
|
|
@ -8,8 +8,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// specific files
|
// specific files
|
||||||
//go:embed favicon-32x32.png robots.txt index.html manifest.json asset-manifest.json
|
|
||||||
// static content
|
// static content
|
||||||
|
//
|
||||||
|
//go:embed favicon-32x32.png robots.txt index.html manifest.json asset-manifest.json
|
||||||
//go:embed static
|
//go:embed static
|
||||||
var files embed.FS
|
var files embed.FS
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ func NewArrayInt(name string, description string) *ArrayInt {
|
||||||
// Flag values may be quoted. For instance, the following arg creates an array of ("a", "b, c") items:
|
// Flag values may be quoted. For instance, the following arg creates an array of ("a", "b, c") items:
|
||||||
//
|
//
|
||||||
// -foo='a,"b, c"'
|
// -foo='a,"b, c"'
|
||||||
//
|
|
||||||
type Array []string
|
type Array []string
|
||||||
|
|
||||||
// String implements flag.Value interface
|
// String implements flag.Value interface
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
// Package metricsql has been moved to https://github.com/VictoriaMetrics/metricsql .
|
// Package metricsql has been moved to https://github.com/VictoriaMetrics/metricsql .
|
||||||
//
|
|
||||||
package metricsql
|
package metricsql
|
||||||
|
|
|
@ -41,10 +41,10 @@ const maxColumnsPerRow = 64 * 1024
|
||||||
// - <column_pos> is numeric csv column position. The first column has position 1.
|
// - <column_pos> is numeric csv column position. The first column has position 1.
|
||||||
// - <column_type> is one of the following types:
|
// - <column_type> is one of the following types:
|
||||||
// - time - the corresponding column contains timestamp. Timestamp format is determined by <extension>. The following formats are supported:
|
// - time - the corresponding column contains timestamp. Timestamp format is determined by <extension>. The following formats are supported:
|
||||||
// - unix_s - unix timestamp in seconds
|
// - - unix_s - unix timestamp in seconds
|
||||||
// - unix_ms - unix timestamp in milliseconds
|
// - - unix_ms - unix timestamp in milliseconds
|
||||||
// - unix_ns - unix_timestamp in nanoseconds
|
// - - unix_ns - unix_timestamp in nanoseconds
|
||||||
// - rfc3339 - RFC3339 format in the form `2006-01-02T15:04:05Z07:00`
|
// - - rfc3339 - RFC3339 format in the form `2006-01-02T15:04:05Z07:00`
|
||||||
// - label - the corresponding column contains metric label with the name set in <extension>.
|
// - label - the corresponding column contains metric label with the name set in <extension>.
|
||||||
// - metric - the corresponding column contains metric value with the name set in <extension>.
|
// - metric - the corresponding column contains metric value with the name set in <extension>.
|
||||||
//
|
//
|
||||||
|
|
|
@ -58,7 +58,7 @@ func (pts *partitionSearch) reset() {
|
||||||
// tsids must be sorted.
|
// tsids must be sorted.
|
||||||
// tsids cannot be modified after the Init call, since it is owned by pts.
|
// tsids cannot be modified after the Init call, since it is owned by pts.
|
||||||
//
|
//
|
||||||
/// MustClose must be called when partition search is done.
|
// MustClose must be called when partition search is done.
|
||||||
func (pts *partitionSearch) Init(pt *partition, tsids []TSID, tr TimeRange) {
|
func (pts *partitionSearch) Init(pt *partition, tsids []TSID, tr TimeRange) {
|
||||||
if pts.needClosing {
|
if pts.needClosing {
|
||||||
logger.Panicf("BUG: missing partitionSearch.MustClose call before the next call to Init")
|
logger.Panicf("BUG: missing partitionSearch.MustClose call before the next call to Init")
|
||||||
|
|
|
@ -567,6 +567,7 @@ func newMatchFuncForOrSuffixes(orValues []string) (reMatch func(b []byte) bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
// getOptimizedReMatchFunc tries returning optimized function for matching the given expr.
|
// getOptimizedReMatchFunc tries returning optimized function for matching the given expr.
|
||||||
|
//
|
||||||
// '.*'
|
// '.*'
|
||||||
// '.+'
|
// '.+'
|
||||||
// 'literal.*'
|
// 'literal.*'
|
||||||
|
|
Loading…
Reference in a new issue