From 2ab64a60241d5fc9a330caa3c7bdf170481579ea Mon Sep 17 00:00:00 2001 From: jorturfer Date: Mon, 11 Oct 2021 15:15:47 +0000 Subject: [PATCH] Refactor a bit the doc Signed-off-by: jorturfer --- CREATE-NEW-SCALER.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CREATE-NEW-SCALER.md b/CREATE-NEW-SCALER.md index 29e12bdc1aa..760148d0e0e 100644 --- a/CREATE-NEW-SCALER.md +++ b/CREATE-NEW-SCALER.md @@ -44,11 +44,14 @@ The return type of this function is `MetricSpec`, but in KEDA's case we will mos - `TargetValue`: is the value of the metric we want to reach at all times at all costs. As long as the current metric doesn't match TargetValue, HPA will increase the number of the pods until it reaches the maximum number of pods allowed to scale to. - `TargetAverageValue`: the value of the metric for which we require one pod to handle. e.g. if we are have a scaler based on the length of a message queue, and we specificy 10 for `TargetAverageValue`, we are saying that each pod will handle 10 messages. So if the length of the queue becomes 30, we expect that we have 3 pods in our cluster. (`TargetAverage` and `TargetValue` are mutually exclusive) ->**Note:** All scalers receive a parameter named `scalerIndex` as part of `ScalerConfig`. This value is the index of the current scaler inside the current ScaledObject. All metric names have to start with `sX-` (where `X` is scalerIndex). This convention makes the metric unique inside the ScaledObject and brings the option to have more than 1 "similar metric name" inside the same ScaledObject. -There is a naming helper function, `GenerateMetricNameWithIndex(scalerIndex int, metricName string)`, that receives the current index and the original metric name (without the prefix) and returns the concatenated string using the convention (we recommend its utilization). +All scalers receive a parameter named `scalerIndex` as part of `ScalerConfig`. This value is the index of the current scaler in a ScaledObject. All metric names have to start with `sX-` (where `X` is `scalerIndex`). This convention makes the metric name unique in the ScaledObject and brings the option to have more than 1 "similar metric name" defined in a ScaledObject. + For example: ->- s0-redis-mylist ->- s1-redis-mylist +- s0-redis-mylist +- s1-redis-mylist + +>**Note:** There is a naming helper function `GenerateMetricNameWithIndex(scalerIndex int, metricName string)`, that receives the current index and the original metric name (without the prefix) and returns the concatenated string using the convention (please use this function). + ### IsActive