diff options
Diffstat (limited to 'src/go/plugin/go.d/modules/litespeed')
7 files changed, 20 insertions, 22 deletions
diff --git a/src/go/plugin/go.d/modules/litespeed/charts.go b/src/go/plugin/go.d/modules/litespeed/charts.go index b7309f28..febfd1e7 100644 --- a/src/go/plugin/go.d/modules/litespeed/charts.go +++ b/src/go/plugin/go.d/modules/litespeed/charts.go @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later +//go:build linux || freebsd || openbsd || netbsd || dragonfly + package litespeed import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" diff --git a/src/go/plugin/go.d/modules/litespeed/collect.go b/src/go/plugin/go.d/modules/litespeed/collect.go index a68cf119..715140ac 100644 --- a/src/go/plugin/go.d/modules/litespeed/collect.go +++ b/src/go/plugin/go.d/modules/litespeed/collect.go @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later +//go:build linux || freebsd || openbsd || netbsd || dragonfly + package litespeed import ( diff --git a/src/go/plugin/go.d/modules/litespeed/doc.go b/src/go/plugin/go.d/modules/litespeed/doc.go new file mode 100644 index 00000000..c6987cdb --- /dev/null +++ b/src/go/plugin/go.d/modules/litespeed/doc.go @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package litespeed diff --git a/src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md b/src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md index 96858fda..9d4cf244 100644 --- a/src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md +++ b/src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md @@ -25,7 +25,10 @@ Examine Litespeed metrics for insights into web server operations. Analyze reque The collector uses the statistics under /tmp/lshttpd to gather the metrics. -This collector is supported on all platforms. +This collector is only supported on the following platforms: + +- Linux +- BSD This collector only supports collecting metrics from a single instance of this integration. @@ -93,8 +96,8 @@ No action required. The configuration file name for this integration is `go.d/litespeed.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/go/plugin/go.d/modules/litespeed/litespeed.go b/src/go/plugin/go.d/modules/litespeed/litespeed.go index f57c0eed..5dbef374 100644 --- a/src/go/plugin/go.d/modules/litespeed/litespeed.go +++ b/src/go/plugin/go.d/modules/litespeed/litespeed.go @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later +//go:build linux || freebsd || openbsd || netbsd || dragonfly + package litespeed import ( @@ -62,7 +64,6 @@ func (l *Litespeed) Init() error { func (l *Litespeed) Check() error { mx, err := l.collect() if err != nil { - l.Error(err) return err } diff --git a/src/go/plugin/go.d/modules/litespeed/litespeed_test.go b/src/go/plugin/go.d/modules/litespeed/litespeed_test.go index 576609dc..10a6b1be 100644 --- a/src/go/plugin/go.d/modules/litespeed/litespeed_test.go +++ b/src/go/plugin/go.d/modules/litespeed/litespeed_test.go @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later +//go:build linux || freebsd || openbsd || netbsd || dragonfly + package litespeed import ( @@ -128,29 +130,14 @@ func TestLitespeed_Collect(t *testing.T) { mx := lite.Collect() assert.Equal(t, test.wantMetrics, mx) + if len(test.wantMetrics) > 0 { - testMetricsHasAllChartsDims(t, lite, mx) + module.TestMetricsHasAllChartsDims(t, lite.Charts(), mx) } }) } } -func testMetricsHasAllChartsDims(t *testing.T, lite *Litespeed, mx map[string]int64) { - for _, chart := range *lite.Charts() { - if chart.Obsolete { - continue - } - for _, dim := range chart.Dims { - _, ok := mx[dim.ID] - assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID) - } - for _, v := range chart.Vars { - _, ok := mx[v.ID] - assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID) - } - } -} - func prepareLitespeedOk() *Litespeed { lite := New() lite.ReportsDir = "testdata" diff --git a/src/go/plugin/go.d/modules/litespeed/metadata.yaml b/src/go/plugin/go.d/modules/litespeed/metadata.yaml index 1c795753..46525e8e 100644 --- a/src/go/plugin/go.d/modules/litespeed/metadata.yaml +++ b/src/go/plugin/go.d/modules/litespeed/metadata.yaml @@ -25,7 +25,7 @@ modules: metrics_description: "Examine Litespeed metrics for insights into web server operations. Analyze request rates, response times, and error rates for efficient web service delivery." method_description: "The collector uses the statistics under /tmp/lshttpd to gather the metrics." supported_platforms: - include: [] + include: [Linux, BSD] exclude: [] multi_instance: false additional_permissions: |