Skip to content

Instantly share code, notes, and snippets.

@floehopper
Last active November 16, 2017 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/45ef153c8e4aac3b6363d3ab3ff177b0 to your computer and use it in GitHub Desktop.
Save floehopper/45ef153c8e4aac3b6363d3ab3ff177b0 to your computer and use it in GitHub Desktop.
aws --region eu-west-1 --profile production cloudwatch get-metric-statistics --namespace AWS/S3 --metric-name BucketSizeBytes --dimensions Name=BucketName,Value=jm-govuk-assets-production Name=StorageType,Value=StandardStorage --start-time 2017-11-01T00:00 --end-time 2017-11-18T00:00 --period 3600 --statistic Maximum | jq -r '.Datapoints[] | [.Timestamp, .Maximum] | @csv' | sort
"2017-11-07T00:00:00Z",1365
"2017-11-08T00:00:00Z",734821
"2017-11-09T00:00:00Z",64893805
"2017-11-10T00:00:00Z",64893805
"2017-11-11T00:00:00Z",64893805
"2017-11-12T00:00:00Z",64893805
"2017-11-13T00:00:00Z",64893805
"2017-11-14T00:00:00Z",64893805
"2017-11-15T00:00:00Z",64893805
"2017-11-16T00:00:00Z",64893805
aws --region eu-west-1 --profile production cloudwatch get-metric-statistics --namespace AWS/S3 --metric-name NumberOfObjects --dimensions Name=BucketName,Value=jm-govuk-assets-production Name=StorageType,Value=AllStorageTypes --start-time 2017-11-01T00:00 --end-time 2017-11-18T00:00 --period 3600 --statistic Maximum | jq -r '.Datapoints[] | [.Timestamp, .Maximum] | @csv' | sort
"2017-11-07T00:00:00Z",1
"2017-11-08T00:00:00Z",5
"2017-11-09T00:00:00Z",8
"2017-11-10T00:00:00Z",8
"2017-11-11T00:00:00Z",8
"2017-11-12T00:00:00Z",8
"2017-11-13T00:00:00Z",8
"2017-11-14T00:00:00Z",8
"2017-11-15T00:00:00Z",8
"2017-11-16T00:00:00Z",8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment