Enables monitoring of group metrics for the Auto Scaling group specified in
AutoScalingGroupName
. You can specify the list of enabled metrics with the
Metrics
parameter.
Auto scaling metrics collection can be turned on only if the InstanceMonitoring
flag, in the Auto Scaling group’s launch configuration, is set to True
.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name or ARN of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: |
|
|
Required |
The granularity to associate with the metrics to collect. Currently, the only legal granularity is “1Minute”. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Enable the collection of metrics.
// Instantiate the class $as = new AmazonAS(); $response = $as->enable_metrics_collection('my-scaling-group', '1Minute', array( 'Metrics' => array( 'GroupMinSize', 'GroupMaxSize', 'GroupDesiredCapacity', 'GroupInServiceInstances', 'GroupPendingInstances', 'GroupTerminatingInstances', 'GroupTotalInstances' ) )); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/as.class.php | Toggle source view (17 lines) | View on GitHub