Skip to content

Commit

Permalink
Change hostname collector type to requests-per-second
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Thiesen <[email protected]>
  • Loading branch information
lucastt committed May 3, 2023
1 parent 0623a2a commit 363b271
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/collector/hostname_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

const (
HostnameMetricType = "hostname-rps"
HostnameMetricType = "requests-per-second"
HostnameRPSQuery = `scalar(sum(rate(%s{host=~"%s"}[1m])) * %.4f)`
)

Expand Down
14 changes: 7 additions & 7 deletions pkg/collector/hostname_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ func TestHostnameCollectorAndCollectorFabricInteraction(t *testing.T) {
hpa := &autoscalingv2.HorizontalPodAutoscaler{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"metric-config.external.foo.hostname-rps/hostnames": "just.testing.com",
"metric-config.external.foo.hostname-rps/weight": "42",
"metric-config.external.foo.requests-per-second/hostnames": "just.testing.com",
"metric-config.external.foo.requests-per-second/weight": "42",
},
},
Spec: autoscalingv2.HorizontalPodAutoscalerSpec{
Expand All @@ -201,7 +201,7 @@ func TestHostnameCollectorAndCollectorFabricInteraction(t *testing.T) {
Metric: autoscalingv2.MetricIdentifier{
Name: "foo",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"type": "hostname-rps"},
MatchLabels: map[string]string{"type": "requests-per-second"},
},
},
},
Expand Down Expand Up @@ -234,9 +234,9 @@ func TestHostnamePrometheusCollectorInteraction(t *testing.T) {
hpa := &autoscalingv2.HorizontalPodAutoscaler{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"metric-config.external.foo.hostname-rps/hostnames": "just.testing.com",
"metric-config.external.foo.hostname-rps/weight": "42",
"metric-config.external.bar.prometheus/query": promQuery,
"metric-config.external.foo.requests-per-second/hostnames": "just.testing.com",
"metric-config.external.foo.requests-per-second/weight": "42",
"metric-config.external.bar.prometheus/query": promQuery,
},
},
Spec: autoscalingv2.HorizontalPodAutoscalerSpec{
Expand All @@ -247,7 +247,7 @@ func TestHostnamePrometheusCollectorInteraction(t *testing.T) {
Metric: autoscalingv2.MetricIdentifier{
Name: "foo",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"type": "hostname-rps"},
MatchLabels: map[string]string{"type": "requests-per-second"},
},
},
},
Expand Down

0 comments on commit 363b271

Please sign in to comment.