Skip to content

Commit

Permalink
Refactor a bit the doc
Browse files Browse the repository at this point in the history
Signed-off-by: jorturfer <[email protected]>
  • Loading branch information
JorTurFer authored and Jorge Turrado committed Oct 13, 2021
1 parent b1391fe commit 2ab64a6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CREATE-NEW-SCALER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2ab64a6

Please sign in to comment.