From 26096e7f326f901c7957dddac16ebb6e6502226e Mon Sep 17 00:00:00 2001 From: TechVest <166724172+TechVest@users.noreply.github.com> Date: Wed, 24 Apr 2024 19:14:27 +0800 Subject: [PATCH] chore: fix some comments (#1818) Signed-off-by: TechVest --- docs/sources/reference/functions.md | 2 +- pkg/timeseries/moving_average.go | 2 +- pkg/zabbixapi/zabbix_api.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sources/reference/functions.md b/docs/sources/reference/functions.md index 55768ae..affadd0 100644 --- a/docs/sources/reference/functions.md +++ b/docs/sources/reference/functions.md @@ -423,7 +423,7 @@ replaceAlias(/(.*): CPU (.*) time/, $1 - $2) -> backend01 - system consolidateBy(consolidationFunc) ``` -When a graph is drawn where width of the graph size in pixels is smaller than the number of datapoints to be graphed, plugin consolidates the values to to prevent line overlap. The consolidateBy() function changes the consolidation function from the default of average to one of `sum`, `min`, `max` or `count`. +When a graph is drawn where width of the graph size in pixels is smaller than the number of datapoints to be graphed, plugin consolidates the values to prevent line overlap. The consolidateBy() function changes the consolidation function from the default of average to one of `sum`, `min`, `max` or `count`. Valid function names are `sum`, `avg`, `min`, `max` and `count`. diff --git a/pkg/timeseries/moving_average.go b/pkg/timeseries/moving_average.go index 23788f9..5b98642 100644 --- a/pkg/timeseries/moving_average.go +++ b/pkg/timeseries/moving_average.go @@ -73,7 +73,7 @@ func (ts TimeSeries) ExponentialMovingAverage(an float64) TimeSeries { an = math.Min(float64(ts.Len()), an) // alpha coefficient should be between 0 and 1. If provided n <= 1, then use it as alpha directly. Otherwise, it's a - // number of points in the window and alpha calculted from this information. + // number of points in the window and alpha calculated from this information. var a float64 var n int ema := []TimePoint{ts[0]} diff --git a/pkg/zabbixapi/zabbix_api.go b/pkg/zabbixapi/zabbix_api.go index 1af189a..009d41e 100644 --- a/pkg/zabbixapi/zabbix_api.go +++ b/pkg/zabbixapi/zabbix_api.go @@ -137,7 +137,7 @@ func (api *ZabbixAPI) Login(ctx context.Context, username string, password strin return auth.MustString(), nil } -// Login methid for Zabbix prior to 5.4 +// Login method for Zabbix prior to 5.4 func (api *ZabbixAPI) LoginDeprecated(ctx context.Context, username string, password string) (string, error) { params := ZabbixAPIParams{ "user": username,