go.d litespeed (#17665)
Ilya Mashchenko committed
May 15, 2024 at 17:25 UTC
873f7e61515662e7095b73773a56323faa7a7077
14 files changed
+741
src/go/collectors/go.d.plugin/README.md
+1
@@ -87,6 +87,7 @@ see the appropriate collector readme.
87
| [k8s_kubeproxy](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy) | Kube-proxy |
88
| [k8s_state](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_state) | Kubernetes cluster state |
89
| [lighttpd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/lighttpd) | Lighttpd |
90
+| [litespeed](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/litespeed) | Litespeed |
91
| [logind](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/logind) | systemd-logind |
92
| [logstash](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/logstash) | Logstash |
93
| [lvm](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/lvm) | LVM logical volumes |
src/go/collectors/go.d.plugin/config/go.d.conf
+1
@@ -49,6 +49,7 @@ modules:
49
# k8s_kubelet: yes
50
# k8s_kubeproxy: yes
51
# lighttpd: yes
52
+# litespeed: yes
53
# logind: yes
54
# logstash: yes
55
# lvm: yes
src/go/collectors/go.d.plugin/config/go.d/litespeed.conf
new
+6
@@ -0,0 +1,6 @@
1
+## All available configuration options, their descriptions and default values:
2
+## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/litespeed#readme
3
+
4
+jobs:
5
+ - name: local
6
+ reports_dir: /tmp/lshttpd/
src/go/collectors/go.d.plugin/modules/init.go
+1
@@ -40,6 +40,7 @@ import (
40
_ "github.com/netdata/netdata/go/go.d.plugin/modules/k8s_kubeproxy"
41
_ "github.com/netdata/netdata/go/go.d.plugin/modules/k8s_state"
42
_ "github.com/netdata/netdata/go/go.d.plugin/modules/lighttpd"
43
+ _ "github.com/netdata/netdata/go/go.d.plugin/modules/litespeed"
44
_ "github.com/netdata/netdata/go/go.d.plugin/modules/logind"
45
_ "github.com/netdata/netdata/go/go.d.plugin/modules/logstash"
46
_ "github.com/netdata/netdata/go/go.d.plugin/modules/lvm"
src/go/collectors/go.d.plugin/modules/litespeed/charts.go
new
+152
@@ -0,0 +1,152 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package litespeed
4
+
5
+import "github.com/netdata/netdata/go/go.d.plugin/agent/module"
6
+
7
+const (
8
+ prioRequests = module.Priority + iota
9
+ prioRequestsProcessing
10
+ prioNetThroughputHttp
11
+ prioNetThroughputHttps
12
+ prioConnectionsHttp
13
+ prioConnectionsHttps
14
+ prioPublicCacheHits
15
+ prioPrivateCacheHits
16
+ prioStaticHits
17
+)
18
+
19
+var charts = module.Charts{
20
+ requestsChart.Copy(),
21
+ requestsProcessingChart.Copy(),
22
+
23
+ netThroughputHttpChart.Copy(),
24
+ netThroughputHttpsChart.Copy(),
25
+
26
+ connectionsHttpChart.Copy(),
27
+ connectionsHttpsChart.Copy(),
28
+
29
+ publicCacheHitsChart.Copy(),
30
+ privateCacheHitsChart.Copy(),
31
+ staticCacheHitsChart.Copy(),
32
+}
33
+
34
+var (
35
+ requestsChart = module.Chart{
36
+ ID: "requests",
37
+ Title: "Requests",
38
+ Units: "requests/s",
39
+ Fam: "requests",
40
+ Ctx: "litespeed.requests",
41
+ Priority: prioRequests,
42
+ Dims: module.Dims{
43
+ {ID: "req_per_sec", Name: "requests", Div: precision},
44
+ },
45
+ }
46
+ requestsProcessingChart = module.Chart{
47
+ ID: "requests_processing",
48
+ Title: "Processing requests",
49
+ Units: "requests",
50
+ Fam: "requests",
51
+ Ctx: "litespeed.requests_processing",
52
+ Priority: prioRequestsProcessing,
53
+ Dims: module.Dims{
54
+ {ID: "req_processing", Name: "processing"},
55
+ },
56
+ }
57
+)
58
+
59
+var (
60
+ netThroughputHttpChart = module.Chart{
61
+ ID: "net_throughput_http",
62
+ Title: "HTTP throughput",
63
+ Units: "kilobits/s",
64
+ Fam: "throughput",
65
+ Ctx: "litespeed.net_throughput",
66
+ Type: module.Area,
67
+ Priority: prioNetThroughputHttp,
68
+ Dims: module.Dims{
69
+ {ID: "bps_in", Name: "in"},
70
+ {ID: "bps_out", Name: "out", Div: -1},
71
+ },
72
+ }
73
+ netThroughputHttpsChart = module.Chart{
74
+ ID: "net_throughput_https",
75
+ Title: "HTTPs throughput",
76
+ Units: "kilobits/s",
77
+ Fam: "throughput",
78
+ Ctx: "litespeed.net_ssl_throughput",
79
+ Type: module.Area,
80
+ Priority: prioNetThroughputHttps,
81
+ Dims: module.Dims{
82
+ {ID: "ssl_bps_in", Name: "in"},
83
+ {ID: "ssl_bps_out", Name: "out", Div: -1},
84
+ },
85
+ }
86
+)
87
+
88
+var (
89
+ connectionsHttpChart = module.Chart{
90
+ ID: "connections_http",
91
+ Title: "HTTP connections",
92
+ Units: "connections",
93
+ Fam: "connections",
94
+ Ctx: "litespeed.connections",
95
+ Type: module.Stacked,
96
+ Priority: prioConnectionsHttp,
97
+ Dims: module.Dims{
98
+ {ID: "availconn", Name: "free"},
99
+ {ID: "plainconn", Name: "used"},
100
+ },
101
+ }
102
+ connectionsHttpsChart = module.Chart{
103
+ ID: "connections_https",
104
+ Title: "HTTPs connections",
105
+ Units: "connections",
106
+ Fam: "connections",
107
+ Ctx: "litespeed.ssl_connections",
108
+ Type: module.Stacked,
109
+ Priority: prioConnectionsHttps,
110
+ Dims: module.Dims{
111
+ {ID: "availssl", Name: "free"},
112
+ {ID: "sslconn", Name: "used"},
113
+ },
114
+ }
115
+)
116
+
117
+var (
118
+ publicCacheHitsChart = module.Chart{
119
+ ID: "pub_cache_hits",
120
+ Title: "Public cache hits",
121
+ Units: "hits/s",
122
+ Fam: "cache",
123
+ Ctx: "litespeed.public_cache",
124
+ Priority: prioPublicCacheHits,
125
+ Dims: module.Dims{
126
+ {ID: "pub_cache_hits_per_sec", Name: "hits", Div: precision},
127
+ },
128
+ }
129
+ privateCacheHitsChart = module.Chart{
130
+ ID: "private_cache_hits",
131
+ Title: "Private cache hits",
132
+ Units: "hits/s",
133
+ Fam: "cache",
134
+ Ctx: "litespeed.private_cache",
135
+ Priority: prioPrivateCacheHits,
136
+ Dims: module.Dims{
137
+ {ID: "private_cache_hits_per_sec", Name: "hits", Div: precision},
138
+ },
139
+ }
140
+
141
+ staticCacheHitsChart = module.Chart{
142
+ ID: "static_hits",
143
+ Title: "Static hits",
144
+ Units: "hits/s",
145
+ Fam: "static",
146
+ Ctx: "litespeed.static",
147
+ Priority: prioStaticHits,
148
+ Dims: module.Dims{
149
+ {ID: "static_hits_per_sec", Name: "hits", Div: precision},
150
+ },
151
+ }
152
+)
src/go/collectors/go.d.plugin/modules/litespeed/collect.go
new
+119
@@ -0,0 +1,119 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package litespeed
4
+
5
+import (
6
+ "bufio"
7
+ "bytes"
8
+ "errors"
9
+ "os"
10
+ "path/filepath"
11
+ "strconv"
12
+ "strings"
13
+)
14
+
15
+const precision = 100
16
+
17
+func (l *Litespeed) collect() (map[string]int64, error) {
18
+ if l.checkDir {
19
+ _, err := os.Stat(l.ReportsDir)
20
+ if err != nil {
21
+ return nil, err
22
+ }
23
+ l.checkDir = false
24
+ }
25
+ reports, err := filepath.Glob(filepath.Join(l.ReportsDir, ".rtreport*"))
26
+ if err != nil {
27
+ return nil, err
28
+ }
29
+
30
+ l.Debugf("found %d reports: %v", len(reports), reports)
31
+
32
+ if len(reports) == 0 {
33
+ return nil, errors.New("no reports found")
34
+ }
35
+
36
+ mx := make(map[string]int64)
37
+
38
+ for _, report := range reports {
39
+ if err := l.collectReport(mx, report); err != nil {
40
+ return nil, err
41
+ }
42
+ }
43
+
44
+ return mx, nil
45
+}
46
+
47
+func (l *Litespeed) collectReport(mx map[string]int64, filename string) error {
48
+ bs, err := os.ReadFile(filename)
49
+ if err != nil {
50
+ return err
51
+ }
52
+
53
+ sc := bufio.NewScanner(bytes.NewReader(bs))
54
+
55
+ var valid bool
56
+
57
+ for sc.Scan() {
58
+ line := sc.Text()
59
+
60
+ switch {
61
+ default:
62
+ continue
63
+ case strings.HasPrefix(line, "BPS_IN:"):
64
+ case strings.HasPrefix(line, "PLAINCONN:"):
65
+ case strings.HasPrefix(line, "MAXCONN:"):
66
+ case strings.HasPrefix(line, "REQ_RATE []:"):
67
+ line = strings.TrimPrefix(line, "REQ_RATE []:")
68
+ }
69
+
70
+ parts := strings.Split(line, ",")
71
+
72
+ for _, part := range parts {
73
+ i := strings.IndexByte(part, ':')
74
+ if i == -1 {
75
+ l.Debugf("Skipping metric '%s': missing colon separator", part)
76
+ continue
77
+ }
78
+
79
+ metric, sVal := strings.TrimSpace(part[:i]), strings.TrimSpace(part[i+1:])
80
+
81
+ val, err := strconv.ParseFloat(sVal, 64)
82
+ if err != nil {
83
+ l.Debugf("Skipping metric '%s': invalid value", part)
84
+ continue
85
+ }
86
+
87
+ key := strings.ToLower(metric)
88
+
89
+ switch metric {
90
+ default:
91
+ continue
92
+ case "REQ_PER_SEC",
93
+ "PUB_CACHE_HITS_PER_SEC",
94
+ "PRIVATE_CACHE_HITS_PER_SEC",
95
+ "STATIC_HITS_PER_SEC":
96
+ mx[key] += int64(val * precision)
97
+ case "BPS_IN",
98
+ "BPS_OUT",
99
+ "SSL_BPS_IN",
100
+ "SSL_BPS_OUT":
101
+ mx[key] += int64(val) * 8
102
+ case "REQ_PROCESSING",
103
+ "PLAINCONN",
104
+ "AVAILCONN",
105
+ "SSLCONN",
106
+ "AVAILSSL":
107
+ mx[key] += int64(val)
108
+ }
109
+ valid = true
110
+
111
+ }
112
+ }
113
+
114
+ if !valid {
115
+ return errors.New("unexpected file: not a litespeed report")
116
+ }
117
+
118
+ return nil
119
+}
src/go/collectors/go.d.plugin/modules/litespeed/config_schema.json
new
+37
@@ -0,0 +1,37 @@
1
+{
2
+ "jsonSchema": {
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "title": "Litespeed collector configuration.",
5
+ "type": "object",
6
+ "properties": {
7
+ "update_every": {
8
+ "title": "Update every",
9
+ "description": "Data collection interval, measured in seconds.",
10
+ "type": "integer",
11
+ "minimum": 1,
12
+ "default": 10
13
+ },
14
+ "reports_dir": {
15
+ "title": "Reports directory",
16
+ "description": "Directory containing Litespeed's real-time statistics files (`.rtreport`)",
17
+ "type": "string",
18
+ "default": "/tmp/lshttpd/"
19
+ }
20
+ },
21
+ "required": [
22
+ "reports_dir"
23
+ ],
24
+ "additionalProperties": false,
25
+ "patternProperties": {
26
+ "^name$": {}
27
+ }
28
+ },
29
+ "uiSchema": {
30
+ "uiOptions": {
31
+ "fullPage": true
32
+ },
33
+ "update_every": {
34
+ "ui:help": "Data is collected by reading Litespeed's report files, which are updated every 10 seconds. Setting the data collection interval to less than 10 seconds wouldn't provide more recent data."
35
+ }
36
+ }
37
+}
src/go/collectors/go.d.plugin/modules/litespeed/litespeed.go
new
+90
@@ -0,0 +1,90 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package litespeed
4
+
5
+import (
6
+ _ "embed"
7
+ "errors"
8
+
9
+ "github.com/netdata/netdata/go/go.d.plugin/agent/module"
10
+)
11
+
12
+//go:embed "config_schema.json"
13
+var configSchema string
14
+
15
+func init() {
16
+ module.Register("litespeed", module.Creator{
17
+ JobConfigSchema: configSchema,
18
+ Defaults: module.Defaults{
19
+ UpdateEvery: 10, // The .rtreport files are generated per worker, and updated every 10 seconds.
20
+ },
21
+ Create: func() module.Module { return New() },
22
+ })
23
+}
24
+
25
+func New() *Litespeed {
26
+ return &Litespeed{
27
+ Config: Config{
28
+ //ReportsDir: "/tmp/lshttpd/",
29
+ ReportsDir: "/opt/litespeed",
30
+ },
31
+ checkDir: true,
32
+ charts: charts.Copy(),
33
+ }
34
+}
35
+
36
+type Config struct {
37
+ UpdateEvery int `yaml:"update_every" json:"update_every"`
38
+ ReportsDir string `yaml:"reports_dir" json:"reports_dir"`
39
+}
40
+
41
+type Litespeed struct {
42
+ module.Base
43
+ Config `yaml:",inline" json:""`
44
+
45
+ checkDir bool
46
+
47
+ charts *module.Charts
48
+}
49
+
50
+func (l *Litespeed) Configuration() any {
51
+ return l.Config
52
+}
53
+
54
+func (l *Litespeed) Init() error {
55
+ if l.ReportsDir == "" {
56
+ return errors.New("reports_dir is required")
57
+ }
58
+ return nil
59
+}
60
+
61
+func (l *Litespeed) Check() error {
62
+ mx, err := l.collect()
63
+ if err != nil {
64
+ l.Error(err)
65
+ return err
66
+ }
67
+
68
+ if len(mx) == 0 {
69
+ return errors.New("no metrics collected")
70
+ }
71
+
72
+ return nil
73
+}
74
+
75
+func (l *Litespeed) Charts() *module.Charts {
76
+ return l.charts
77
+}
78
+
79
+func (l *Litespeed) Collect() map[string]int64 {
80
+ mx, err := l.collect()
81
+
82
+ if err != nil {
83
+ l.Error(err)
84
+ return nil
85
+ }
86
+
87
+ return mx
88
+}
89
+
90
+func (l *Litespeed) Cleanup() {}
src/go/collectors/go.d.plugin/modules/litespeed/litespeed_test.go
new
+164
@@ -0,0 +1,164 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package litespeed
4
+
5
+import (
6
+ "os"
7
+ "testing"
8
+
9
+ "github.com/netdata/netdata/go/go.d.plugin/agent/module"
10
+
11
+ "github.com/stretchr/testify/assert"
12
+ "github.com/stretchr/testify/require"
13
+)
14
+
15
+var (
16
+ dataConfigJSON, _ = os.ReadFile("testdata/config.json")
17
+ dataConfigYAML, _ = os.ReadFile("testdata/config.yaml")
18
+)
19
+
20
+func Test_testDataIsValid(t *testing.T) {
21
+ for name, data := range map[string][]byte{
22
+ "dataConfigJSON": dataConfigJSON,
23
+ "dataConfigYAML": dataConfigYAML,
24
+ } {
25
+ require.NotNil(t, data, name)
26
+ }
27
+}
28
+
29
+func TestLitespeed_ConfigurationSerialize(t *testing.T) {
30
+ module.TestConfigurationSerialize(t, &Litespeed{}, dataConfigJSON, dataConfigYAML)
31
+}
32
+
33
+func TestLitespeed_Init(t *testing.T) {
34
+ tests := map[string]struct {
35
+ wantFail bool
36
+ config Config
37
+ }{
38
+ "success with default": {
39
+ wantFail: false,
40
+ config: New().Config,
41
+ },
42
+ "fails if reports_dir not set": {
43
+ wantFail: true,
44
+ config: Config{
45
+ ReportsDir: "",
46
+ },
47
+ },
48
+ }
49
+
50
+ for name, test := range tests {
51
+ t.Run(name, func(t *testing.T) {
52
+ lite := New()
53
+ lite.Config = test.config
54
+
55
+ if test.wantFail {
56
+ assert.Error(t, lite.Init())
57
+ } else {
58
+ assert.NoError(t, lite.Init())
59
+ }
60
+ })
61
+ }
62
+}
63
+
64
+func TestLitespeed_Charts(t *testing.T) {
65
+ assert.NotNil(t, New().Charts())
66
+}
67
+
68
+func TestLitespeed_Check(t *testing.T) {
69
+ tests := map[string]struct {
70
+ prepareLitespeed func() *Litespeed
71
+ wantFail bool
72
+ }{
73
+ "success": {
74
+ wantFail: false,
75
+ prepareLitespeed: prepareLitespeedOk,
76
+ },
77
+ "fails if reports dir not exist": {
78
+ wantFail: true,
79
+ prepareLitespeed: prepareLitespeedDirNotExist,
80
+ },
81
+ }
82
+
83
+ for name, test := range tests {
84
+ t.Run(name, func(t *testing.T) {
85
+ lite := test.prepareLitespeed()
86
+
87
+ if test.wantFail {
88
+ assert.Error(t, lite.Check())
89
+ } else {
90
+ assert.NoError(t, lite.Check())
91
+ }
92
+ })
93
+ }
94
+}
95
+
96
+func TestLitespeed_Collect(t *testing.T) {
97
+ tests := map[string]struct {
98
+ prepareLitespeed func() *Litespeed
99
+ wantMetrics map[string]int64
100
+ }{
101
+ "success": {
102
+ prepareLitespeed: prepareLitespeedOk,
103
+ wantMetrics: map[string]int64{
104
+ "availconn": 3804,
105
+ "availssl": 3814,
106
+ "bps_in": 0,
107
+ "bps_out": 240,
108
+ "plainconn": 10,
109
+ "private_cache_hits_per_sec": 0,
110
+ "pub_cache_hits_per_sec": 0,
111
+ "req_per_sec": 1560,
112
+ "req_processing": 168,
113
+ "ssl_bps_in": 16,
114
+ "ssl_bps_out": 3120,
115
+ "sslconn": 186,
116
+ "static_hits_per_sec": 760,
117
+ },
118
+ },
119
+ "fails if reports dir not exist": {
120
+ prepareLitespeed: prepareLitespeedDirNotExist,
121
+ },
122
+ }
123
+
124
+ for name, test := range tests {
125
+ t.Run(name, func(t *testing.T) {
126
+ lite := test.prepareLitespeed()
127
+
128
+ mx := lite.Collect()
129
+
130
+ assert.Equal(t, test.wantMetrics, mx)
131
+ if len(test.wantMetrics) > 0 {
132
+ testMetricsHasAllChartsDims(t, lite, mx)
133
+ }
134
+ })
135
+ }
136
+}
137
+
138
+func testMetricsHasAllChartsDims(t *testing.T, lite *Litespeed, mx map[string]int64) {
139
+ for _, chart := range *lite.Charts() {
140
+ if chart.Obsolete {
141
+ continue
142
+ }
143
+ for _, dim := range chart.Dims {
144
+ _, ok := mx[dim.ID]
145
+ assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID)
146
+ }
147
+ for _, v := range chart.Vars {
148
+ _, ok := mx[v.ID]
149
+ assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID)
150
+ }
151
+ }
152
+}
153
+
154
+func prepareLitespeedOk() *Litespeed {
155
+ lite := New()
156
+ lite.ReportsDir = "testdata"
157
+ return lite
158
+}
159
+
160
+func prepareLitespeedDirNotExist() *Litespeed {
161
+ lite := prepareLitespeedOk()
162
+ lite.ReportsDir += "!"
163
+ return lite
164
+}
src/go/collectors/go.d.plugin/modules/litespeed/metadata.yaml
new
+148
@@ -0,0 +1,148 @@
1
+plugin_name: go.d.plugin
2
+modules:
3
+ - meta:
4
+ id: collector-go.d.plugin-litespeed
5
+ plugin_name: go.d.plugin
6
+ module_name: litespeed
7
+ monitored_instance:
8
+ name: Litespeed
9
+ link: "https://www.litespeedtech.com/products/litespeed-web-server"
10
+ categories:
11
+ - data-collection.web-servers-and-web-proxies
12
+ icon_filename: "litespeed.svg"
13
+ related_resources:
14
+ integrations:
15
+ list: []
16
+ info_provided_to_referring_integrations:
17
+ description: ""
18
+ keywords:
19
+ - litespeed
20
+ - web
21
+ - server
22
+ most_popular: false
23
+ overview:
24
+ data_collection:
25
+ metrics_description: "Examine Litespeed metrics for insights into web server operations. Analyze request rates, response times, and error rates for efficient web service delivery."
26
+ method_description: "The collector uses the statistics under /tmp/lshttpd to gather the metrics."
27
+ supported_platforms:
28
+ include: []
29
+ exclude: []
30
+ multi_instance: false
31
+ additional_permissions:
32
+ description: ""
33
+ default_behavior:
34
+ auto_detection:
35
+ description: "If no configuration is present, the collector will attempt to read files under /tmp/lshttpd/."
36
+ limits:
37
+ description: ""
38
+ performance_impact:
39
+ description: ""
40
+ setup:
41
+ prerequisites:
42
+ list: []
43
+ configuration:
44
+ file:
45
+ name: go.d/litespeed.conf
46
+ options:
47
+ description: |
48
+ The following options can be defined globally: update_every, autodetection_retry.
49
+ folding:
50
+ title: Config options
51
+ enabled: true
52
+ list:
53
+ - name: update_every
54
+ description: Data collection frequency.
55
+ default_value: 10
56
+ required: false
57
+ - name: autodetection_retry
58
+ description: Sets the job re-check interval in seconds.
59
+ default_value: 0
60
+ required: false
61
+ - name: reports_dir
62
+ description: Directory containing Litespeed's real-time statistics files.
63
+ default_value: "/tmp/lshttpd/"
64
+ required: false
65
+ examples:
66
+ folding:
67
+ enabled: false
68
+ title: "Config"
69
+ list:
70
+ - name: Set the path to statistics
71
+ description: Change the path for the litespeed stats files
72
+ config: |
73
+ local:
74
+ name: 'local'
75
+ path: '/tmp/lshttpd'
76
+ troubleshooting:
77
+ problems:
78
+ list: []
79
+ alerts: []
80
+ metrics:
81
+ folding:
82
+ title: Metrics
83
+ enabled: false
84
+ description: ""
85
+ availability: []
86
+ scopes:
87
+ - name: global
88
+ description: "These metrics refer to the entire monitored application."
89
+ labels: []
90
+ metrics:
91
+ - name: litespeed.requests
92
+ description: Requests
93
+ unit: "requests/s"
94
+ chart_type: line
95
+ dimensions:
96
+ - name: requests
97
+ - name: litespeed.requests_processing
98
+ description: Requests In Processing
99
+ unit: "requests"
100
+ chart_type: line
101
+ dimensions:
102
+ - name: processing
103
+ - name: litespeed.net_throughput
104
+ description: Network Throughput HTTP
105
+ unit: "kilobits/s"
106
+ chart_type: area
107
+ dimensions:
108
+ - name: in
109
+ - name: out
110
+ - name: litespeed.net_ssl_throughput
111
+ description: Network Throughput HTTPS
112
+ unit: "kilobits/s"
113
+ chart_type: area
114
+ dimensions:
115
+ - name: in
116
+ - name: out
117
+ - name: litespeed.connections
118
+ description: Connections HTTP
119
+ unit: "conns"
120
+ chart_type: stacked
121
+ dimensions:
122
+ - name: free
123
+ - name: used
124
+ - name: litespeed.ssl_connections
125
+ description: Connections HTTPS
126
+ unit: "conns"
127
+ chart_type: stacked
128
+ dimensions:
129
+ - name: free
130
+ - name: used
131
+ - name: litespeed.public_cache
132
+ description: Public Cache Hits
133
+ unit: "hits/s"
134
+ chart_type: line
135
+ dimensions:
136
+ - name: hits
137
+ - name: litespeed.private_cache
138
+ description: Private Cache Hits
139
+ unit: "hits/s"
140
+ chart_type: line
141
+ dimensions:
142
+ - name: hits
143
+ - name: litespeed.static
144
+ description: Static Hits
145
+ unit: "hits/s"
146
+ chart_type: line
147
+ dimensions:
148
+ - name: hits
src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport
new
+8
@@ -0,0 +1,8 @@
1
+VERSION: LiteSpeed Web Server/Enterprise/5.2.7
2
+UPTIME: 02:31:56
3
+BPS_IN: 0, BPS_OUT: 15, SSL_BPS_IN: 1, SSL_BPS_OUT: 195
4
+MAXCONN: 2000, MAXSSL_CONN: 2000, PLAINCONN: 5, AVAILCONN: 1902, IDLECONN: 14, SSLCONN: 93, AVAILSSL: 1907
5
+REQ_RATE []: REQ_PROCESSING: 84, REQ_PER_SEC: 7.8, TOT_REQS: 92899, PUB_CACHE_HITS_PER_SEC: 0.0, TOTAL_PUB_CACHE_HITS: 9, PRIVATE_CACHE_HITS_PER_SEC: 0.0, TOTAL_PRIVATE_CACHE_HITS: 0, STATIC_HITS_PER_SEC: 3.8, TOTAL_STATIC_HITS: 53244
6
+REQ_RATE [APVH_149.202.xxx.xxxx:443_example.com]: REQ_PROCESSING: 0, REQ_PER_SEC: 0.0, TOT_REQS: 0, PUB_CACHE_HITS_PER_SEC: 0.0, TOTAL_PUB_CACHE_HITS: 0, PRIVATE_CACHE_HITS_PER_SEC: 0.0, TOTAL_PRIVATE_CACHE_HITS: 0, STATIC_HITS_PER_SEC: 0.0, TOTAL_STATIC_HITS: 0
7
+EXTAPP [CGI] [] [lscgid]: CMAXCONN: 200, EMAXCONN: 200, POOL_SIZE: 1, INUSE_CONN: 0, IDLE_CONN: 1, WAITQUE_DEPTH: 0, REQ_PER_SEC: 0.0, TOT_REQS: 41
8
+EXTAPP [Proxy] [] [http://127.0.0.1]: CMAXCONN: 10, EMAXCONN: 10, POOL_SIZE: 1, INUSE_CONN: 0, IDLE_CONN: 1, WAITQUE_DEPTH: 0, REQ_PER_SEC: 0.0, TOT_REQS: 20
src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport.2
new
+8
@@ -0,0 +1,8 @@
1
+VERSION: LiteSpeed Web Server/Enterprise/5.2.7
2
+UPTIME: 02:31:56
3
+BPS_IN: 0, BPS_OUT: 15, SSL_BPS_IN: 1, SSL_BPS_OUT: 195
4
+MAXCONN: 2000, MAXSSL_CONN: 2000, PLAINCONN: 5, AVAILCONN: 1902, IDLECONN: 14, SSLCONN: 93, AVAILSSL: 1907
5
+REQ_RATE []: REQ_PROCESSING: 84, REQ_PER_SEC: 7.8, TOT_REQS: 92899, PUB_CACHE_HITS_PER_SEC: 0.0, TOTAL_PUB_CACHE_HITS: 9, PRIVATE_CACHE_HITS_PER_SEC: 0.0, TOTAL_PRIVATE_CACHE_HITS: 0, STATIC_HITS_PER_SEC: 3.8, TOTAL_STATIC_HITS: 53244
6
+REQ_RATE [APVH_149.202.xxx.xxxx:443_example.com]: REQ_PROCESSING: 0, REQ_PER_SEC: 0.0, TOT_REQS: 0, PUB_CACHE_HITS_PER_SEC: 0.0, TOTAL_PUB_CACHE_HITS: 0, PRIVATE_CACHE_HITS_PER_SEC: 0.0, TOTAL_PRIVATE_CACHE_HITS: 0, STATIC_HITS_PER_SEC: 0.0, TOTAL_STATIC_HITS: 0
7
+EXTAPP [CGI] [] [lscgid]: CMAXCONN: 200, EMAXCONN: 200, POOL_SIZE: 1, INUSE_CONN: 0, IDLE_CONN: 1, WAITQUE_DEPTH: 0, REQ_PER_SEC: 0.0, TOT_REQS: 41
8
+EXTAPP [Proxy] [] [http://127.0.0.1]: CMAXCONN: 10, EMAXCONN: 10, POOL_SIZE: 1, INUSE_CONN: 0, IDLE_CONN: 1, WAITQUE_DEPTH: 0, REQ_PER_SEC: 0.0, TOT_REQS: 20
src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.json
new
+4
@@ -0,0 +1,4 @@
1
+{
2
+ "update_every": 123,
3
+ "reports_dir": "ok"
4
+}
src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.yaml
new
+2
@@ -0,0 +1,2 @@
1
+update_every: 123
2
+reports_dir: "ok"