Skip to content

Commit

Permalink
PR comments 1
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
  • Loading branch information
ahmelsayed committed Jul 28, 2020
1 parent 7381c42 commit 2d3c7cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions content/docs/2.0/concepts/external-scalers.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ service ExternalScaler {
}
```

- `GetMetrics` and `GetMetricsSpec` mirror their counterparts in the `Scaler` interface for creating HPA definition
- `IsActive` maps to the `IsActive` method on the `Scaler` interface
- `StreamingIsActive` maps to the `Run` method on the `PushScaler` interface.
- `GetMetricSpec` returns the target value for the HPA definition for the scaler. For more details refer to [Implementing `GetMetricSpec`](#5-implementing-getmetricspec)
- `GetMetrics` returns the value of the metric refered to from `GetMetricSpec`. For more details refer to [Implementing `GetMetrics`](#6-implementing-getmetrics)

> Refer to the [HPA docs](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) for how HPA calculates replicaCount based on metric value and target value.
Few things to notice:
- Lack of `Close` method as the GRPC connection defines the lifetime of the scaler
Expand Down Expand Up @@ -498,7 +501,7 @@ server.addService(externalScalerProto.externalscaler.ExternalScaler.service, {

#### 6. Implementing `GetMetrics`

`GetMetrics` returns the value of the metric refered to from `GetMetricSpec`, in this example it's `earthquakeThreshold`. Refer to the [HPA docs](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) for how HPA calculates replicaCount based on metric value and target value.
`GetMetrics` returns the value of the metric refered to from `GetMetricSpec`, in this example it's `earthquakeThreshold`.

{{< collapsible "Golang" >}}
```golang
Expand Down

0 comments on commit 2d3c7cf

Please sign in to comment.