cloudwatcher

package module
v0.0.0-...-09bf9fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

README

AWS CloudWatcher Library

Go Report Card

This is a simple Go library that wraps the "AWS GO SDK" library to provide a way to query AWS Cloudwatch metrics from EC2 instances.

Example Usage:

fmt.Println(cloudwatcher.GetMetricData("aws_region", "your_instance_ID"))

Example output:

{
  MetricDataResults: [{
      Id: "id1",
      Label: "CPUUtilization",
      StatusCode: "Complete",
      Timestamps: [
        2018-12-03 14:39:00 +0000 UTC,
        2018-12-03 14:34:00 +0000 UTC,
        2018-12-03 14:29:00 +0000 UTC,
        2018-12-03 14:24:00 +0000 UTC,
        2018-12-03 14:19:00 +0000 UTC,
        2018-12-03 14:14:00 +0000 UTC,
        2018-12-03 14:09:00 +0000 UTC,
        2018-12-03 14:04:00 +0000 UTC,
        2018-12-03 13:59:00 +0000 UTC,
        2018-12-03 13:54:00 +0000 UTC,
        2018-12-03 13:49:00 +0000 UTC
      ],
      Values: [
        1.999435028248588,
        0.0338983050847462,
        0,
        0.032786885245900996,
        0.0338983050847462,
        0,
        0.233333333333334,
        0.0333333333333338,
        0.6595628415300541,
        0.0333333333333332,
        1.240279707326108
      ]
    }]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetricData

func GetMetricData(region string, instanceID string) *cloudwatch.GetMetricDataOutput

GetMetricData is a func to get CPU-Utilization for the last hour for the instance in the specified region

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL