Skip to content

Commit

Permalink
Use input metric name consistently when reporting Job metrics (#984)
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Bhargava <993682+nbhargava@users.noreply.github.com>
  • Loading branch information
nbhargava committed Aug 11, 2020
1 parent ff053e0 commit bcc7526
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pkg/scalers/cron_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

const (
defaultDesiredReplicas = 1
cronMetricName = "ReplicaCount"
cronMetricType = "External"
)

Expand Down Expand Up @@ -169,7 +168,7 @@ func (s *cronScaler) GetMetrics(ctx context.Context, metricName string, metricSe

/*******************************************************************************/
metric := external_metrics.ExternalMetricValue{
MetricName: cronMetricName,
MetricName: metricName,
Value: *resource.NewQuantity(currentReplicas, resource.DecimalSI),
Timestamp: metav1.Now(),
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/scalers/postgresql_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
)

const (
pgMetricName = "num"
defaultPostgreSQLPassword = ""
)

Expand Down Expand Up @@ -213,7 +212,7 @@ func (s *postgreSQLScaler) GetMetrics(ctx context.Context, metricName string, me
}

metric := external_metrics.ExternalMetricValue{
MetricName: pgMetricName,
MetricName: metricName,
Value: *resource.NewQuantity(int64(num), resource.DecimalSI),
Timestamp: metav1.Now(),
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scalers/rabbitmq_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (s *rabbitMQScaler) GetMetrics(ctx context.Context, metricName string, metr
}

metric := external_metrics.ExternalMetricValue{
MetricName: rabbitQueueLengthMetricName,
MetricName: metricName,
Value: *resource.NewQuantity(int64(messages), resource.DecimalSI),
Timestamp: metav1.Now(),
}
Expand Down

0 comments on commit bcc7526

Please sign in to comment.