Skip to content

Instantly share code, notes, and snippets.

@kskb
Created March 23, 2015 06:11
Show Gist options
  • Save kskb/ed1b7ccfc95e4df04b70 to your computer and use it in GitHub Desktop.
Save kskb/ed1b7ccfc95e4df04b70 to your computer and use it in GitHub Desktop.
AWS SDK for Ruby v2 Aws::CloudWatch::Client#get_metric_statistics sample
require 'aws-sdk-core'
require 'active_support'
require 'active_support/core_ext'
cw = Aws::CloudWatch::Client.new( region: 'us-east-1')
resp = cw.get_metric_statistics(
namespace: "AWS/Billing",
metric_name: "EstimatedCharges",
dimensions: [
{name: "Currency", value: "USD"}
],
start_time: Time.now - 1.days,
end_time: Time.now,
period: 60*60*6,
statistics: ["Maximum"],
)
p resp
@MasterChenGitHub
Copy link

啊啊啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment