7

在此处输入图像描述

任何人都可以解释如何使用 AWS PHP 开发工具包以上述屏幕的样式记录指标。

我使用以下 PHP 代码,但选择菜单显示“ ELB:AvaliabiltyZone ”,如何使其显示“ Aggregated by AvaliabiltyZone ”?这里使用的逻辑是什么?

$response = $cw->put_metric_data("ELB", array(  
    array(  
        "MetricName" => "Latency",  
        "Dimensions" => array(  
            array("Name" => "AvaliabiltyZone"  , "Value" => "us-east-1c")
        ),  
        "Timestamp" => "now",  
        "Value"     => 1,  
        "Unit"      => "None"  
    ),  
));  
4

2 回答 2

3

AvaliabiltyZone

You misspelled "AvailabilityZone"

This maybe won't answer the question, but it might fix some things...

于 2013-06-13T08:59:09.750 回答
0
$cw = new AmazonCloudWatch(); 
$cw->set_region('monitoring.'.$region.'amazonaws.com');

$res1  =  $CW->put_metric_data('Sys/RDS' ,
             array(array('MetricName'  => 'Uptime' ,
                         'Dimensions'  => array(array('Name'  => 'AvaliabiltyZone',
                                                      'Value' => 'us-east-1c')),
                         'Value'       => $Uptime,
                         'Unit'        => 'Seconds')));

点击这里

于 2013-06-24T10:11:25.387 回答