Skip to content

Commit

Permalink
Move autoscaler docs to package documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephburnett committed Feb 28, 2018
1 parent 9ecea8d commit 13dbf7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
17 changes: 0 additions & 17 deletions pkg/autoscaler/autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,6 @@ import (
"github.com/google/elafros/pkg/autoscaler/types"
)

// Autoscaler calculates the number of pods necessary for the desired
// level of concurrency per pod (stableConcurrencyPerPod). It operates in
// two modes, stable mode and panic mode.

// Stable mode calculates the average concurrency observed over the last
// 60 seconds and adjusts the observed pod count to achieve the target
// value. Current observed pod count is the number of unique pod names
// which show up in the last 60 seconds.

// Panic mode calculates the average concurrency observed over the last 6
// seconds and adjusts the observed pod count to achieve the stable
// target value. Panic mode is engaged when the observed 6 second average
// concurrency reaches 2x the target stable concurrency. Panic mode will
// last at least 60 seconds--longer if the 2x threshold is repeatedly
// breached. During panic mode the number of pods is never decreased in
// order to prevent flapping.

const (
stableWindowSeconds float64 = 60
stableWindow time.Duration = 60 * time.Second
Expand Down
18 changes: 18 additions & 0 deletions pkg/autoscaler/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package Autoscaler

// Autoscaler calculates the number of pods necessary for the desired
// level of concurrency per pod (stableConcurrencyPerPod). It operates in
// two modes, stable mode and panic mode.

// Stable mode calculates the average concurrency observed over the last
// 60 seconds and adjusts the observed pod count to achieve the target
// value. Current observed pod count is the number of unique pod names
// which show up in the last 60 seconds.

// Panic mode calculates the average concurrency observed over the last 6
// seconds and adjusts the observed pod count to achieve the stable
// target value. Panic mode is engaged when the observed 6 second average
// concurrency reaches 2x the target stable concurrency. Panic mode will
// last at least 60 seconds--longer if the 2x threshold is repeatedly
// breached. During panic mode the number of pods is never decreased in
// order to prevent flapping.

0 comments on commit 13dbf7c

Please sign in to comment.