Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GroupReq ¶
type GroupReq struct { // Direction is the scaling direction which the group is requested to change. Direction Direction // Count is the number by which to change the count by in the desired direction. This // information can also be found within the GroupScalingPolicy, but the API and the internal // autoscaler have different ways in which to process data so it is their responsibility to // populate this field for use and moves this logic away from the trigger. Count int // GroupName is the name of the job group to scale in this request. GroupName string // GroupScalingPolicy should include the job group scaling policy if it exists within the // Sherpa server. GroupScalingPolicy *policy.GroupScalingPolicy }
GroupReq is a single item of scaling information for a single job group.
func (*GroupReq) MarshalZerologObject ¶
type Scale ¶
type Scale interface { // Trigger performs scaling of 1 or more job groups which belong to the same job. Trigger(string, []*GroupReq, state.Source) (*ScalingResponse, int, error) // GetDeploymentChannel is used to return the channel where updates to Nomad deployments should // be sent. GetDeploymentChannel() chan interface{} // RunDeploymentUpdateHandler is used to trigger the long running process which handles // messages sent to the deployment update channel. RunDeploymentUpdateHandler() // JobGroupIsDeploying checks internal references to identify if the queried job group is // currently in deployment. JobGroupIsDeploying(job, group string) bool // contains filtered or unexported methods }
Scale is the interface used for scaling a Nomad job.
type Scaler ¶
type Scaler struct {
// contains filtered or unexported fields
}
func (*Scaler) GetDeploymentChannel ¶ added in v0.2.0
func (s *Scaler) GetDeploymentChannel() chan interface{}
GetDeploymentChannel will return the channel where deployment updates should be sent.
func (*Scaler) JobGroupIsDeploying ¶ added in v0.2.0
JobGroupIsDeploying returns a boolean to indicate where or not the specified job and group is currently in deployment.
func (*Scaler) RunDeploymentUpdateHandler ¶ added in v0.2.0
func (s *Scaler) RunDeploymentUpdateHandler()
RunDeploymentUpdateHandler is used to handle updates and shutdowns when monitoring Nomad job deployments.
func (*Scaler) Trigger ¶
func (s *Scaler) Trigger(jobID string, groupReqs []*GroupReq, source state.Source) (*ScalingResponse, int, error)
Trigger performs scaling of 1 or more job groups which belong to the same job.
The return values indicate:
- the Nomad API job register response
- the HTTP return code, used for the Sherpa API
- any error
type ScalingResponse ¶ added in v0.1.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.