cloudwatch

package
v0.0.0-...-1a19813 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2015 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	STATISTIC_Average     = "Average"
	STATISTIC_Sum         = "Sum"
	STATISTIC_SampleCount = "SampleCount"
	STATISTIC_Maximum     = "Maximum"
	STATISTIC_Minimum     = "Minimum"
)
View Source
const (
	UNIT_SECONDS              = "Seconds"
	UNIT_MICROSECONDS         = "Microseconds"
	UNIT_MILLISECONDS         = "Milliseconds"
	UNIT_BYTES                = "Bytes"
	UNIT_KILOBYTES            = "Kilobytes"
	UNIT_MEGABYTES            = "Megabytes"
	UNIT_GIGABYTES            = "Gigabytes"
	UNIT_TERABYTES            = "Terabytes"
	UNIT_BITS                 = "Bits"
	UNIT_KILOBITS             = "Kilobits"
	UNIT_MEGABITS             = "Megabits"
	UNIT_GIGABITS             = "Gigabits"
	UNIT_TERABITS             = "Terabits"
	UNIT_PERCENT              = "Percent"
	UNIT_COUNT                = "Count"
	UNIT_BYTES_PER_SECOND     = "Bytes/Second"
	UNIT_KILOBYTES_PER_SECOND = "Kilobytes/Second"
	UNIT_MEGABYTES_PER_SECOND = "Megabytes/Second"
	UNIT_GIGABYTES_PER_SECOND = "Gigabytes/Second"
	UNIT_TERABYTES_PER_SECOND = "Terabytes/Second"
	UNIT_BITS_PER_SECOND      = "Bits/Second"
	UNIT_KILOBITS_PER_SECOND  = "Kilobits/Second"
	UNIT_MEGABITS_PER_SECOND  = "Megabits/Second"
	UNIT_GIGABITS_PER_SECOND  = "Gigabits/Second"
	UNIT_TERABITS_PER_SECOND  = "Terabits/Second"
	UNIT_COUNT_PER_SECOND     = "Count/Second"
	UNIT_NONE                 = "None"
)
View Source
const (
	ResourceAlreadyExistsExceptionType = "ResourceAlreadyExistsException"
	InvalidSequenceTokenExceptionType  = "InvalidSequenceTokenException"
	DataAlreadyAcceptedExceptionType   = "DataAlreadyAcceptedException"
)

Variables

This section is empty.

Functions

func CheckForErrorResponse

func CheckForErrorResponse(response []byte, statusCode int) error

func CloseOffThreadSender

func CloseOffThreadSender()

func CreateOffThreadSender

func CreateOffThreadSender() bool

* Creates a worker to send metrics.

  • return false if we already have the max number of proces

func ExtractNextTokenFromError

func ExtractNextTokenFromError(e *ErrorResult) string

func GetOffThreadSenderCount

func GetOffThreadSenderCount() int

func MultiKeyValueDimensionMetrics

func MultiKeyValueDimensionMetrics(name []string, value []float64, unit []string, namespace string, dimensions [][]MetricDimensions, sendOnThisThread bool) error

func MultiKeyValueMetrics

func MultiKeyValueMetrics(name []string, value []float64, unit []string, namespace string, sendOnThisThread bool) error

func NewTimedEvent

func NewTimedEvent(name, namespace string, onThisThread bool) timedEvent

func SetMaxOffThreadSenders

func SetMaxOffThreadSenders(amt int)

func SimpleKeyValueMetric

func SimpleKeyValueMetric(name string, value float64, unit string, namespace string, sendOnThisThread bool) error

*

  • Creates a single metric and posts it.
  • Sets the metric name, value, unit and namespace for the given parameters.
  • Also sets timestamp to time.Now()
  • if sendOnThisThread is set to true then this request will block to send it.
  • Otherwise it will be pushed into a channel to be sent by a worker created
  • in CreateOffThreadSender().

Types

type CreateLogGroupRequest

type CreateLogGroupRequest struct {
	awsgo.RequestBuilder

	LogGroupName string `json:"logGroupName"`
}

func NewCreateLogGroupRequest

func NewCreateLogGroupRequest() *CreateLogGroupRequest

func (CreateLogGroupRequest) DeMarshalResponse

func (req CreateLogGroupRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (CreateLogGroupRequest) Request

func (*CreateLogGroupRequest) VerifyInput

func (req *CreateLogGroupRequest) VerifyInput() error

type CreateLogGroupResponse

type CreateLogGroupResponse struct {
}

type CreateLogStreamRequest

type CreateLogStreamRequest struct {
	awsgo.RequestBuilder

	LogGroupName  string `json:"logGroupName"`
	LogStreamName string `json:"logStreamName"`
}

func NewCreateLogStreamRequest

func NewCreateLogStreamRequest() *CreateLogStreamRequest

func (CreateLogStreamRequest) DeMarshalResponse

func (req CreateLogStreamRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (CreateLogStreamRequest) Request

func (*CreateLogStreamRequest) VerifyInput

func (req *CreateLogStreamRequest) VerifyInput() error

type CreateLogStreamResponse

type CreateLogStreamResponse struct {
}

type DescribeLogGroupsRequest

type DescribeLogGroupsRequest struct {
	awsgo.RequestBuilder

	LogGroupNamePrefix string `json:"logGroupNamePrefix,omitempty"`
	Limit              *int   `json:"limit,omitempty"`
	NextToken          string `json:"nextToken,omitempty"`
}

func NewDescribeLogGroupsRequest

func NewDescribeLogGroupsRequest() *DescribeLogGroupsRequest

func (DescribeLogGroupsRequest) DeMarshalResponse

func (req DescribeLogGroupsRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (DescribeLogGroupsRequest) Request

func (*DescribeLogGroupsRequest) SetLimit

func (req *DescribeLogGroupsRequest) SetLimit(limit int)

func (*DescribeLogGroupsRequest) VerifyInput

func (req *DescribeLogGroupsRequest) VerifyInput() error

type DescribeLogGroupsResponse

type DescribeLogGroupsResponse struct {
	NextToken string     `json:"nextToken"`
	LogGroups []LogGroup `json:"logGroups"`
}

type DescribeLogStreamsRequest

type DescribeLogStreamsRequest struct {
	awsgo.RequestBuilder

	LogGroupName        string `json:"logGroupName"`
	LogStreamNamePrefix string `json:"logStreamNamePrefix,omitempty"`
	Limit               *int   `json:"limit,omitempty"`
	NextToken           string `json:"nextToken,omitempty"`
}

func NewDescribeLogStreamsRequest

func NewDescribeLogStreamsRequest() *DescribeLogStreamsRequest

func (DescribeLogStreamsRequest) DeMarshalResponse

func (req DescribeLogStreamsRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (DescribeLogStreamsRequest) Request

func (*DescribeLogStreamsRequest) SetLimit

func (req *DescribeLogStreamsRequest) SetLimit(limit int)

func (*DescribeLogStreamsRequest) VerifyInput

func (req *DescribeLogStreamsRequest) VerifyInput() error

type DescribeLogStreamsResponse

type DescribeLogStreamsResponse struct {
	NextToken  string      `json:"nextToken"`
	LogStreams []LogStream `json:"logStreams"`
}

type ErrorResult

type ErrorResult struct {
	Type       string `json:"__type"`
	Message    string `json:"message"`
	StatusCode int
}

func (*ErrorResult) Error

func (e *ErrorResult) Error() string

type GetLogEventsRequest

type GetLogEventsRequest struct {
	awsgo.RequestBuilder

	LogGroupName  string `json:"logGroupName"`
	LogStreamName string `json:"logStreamName"`
	EndTime       *int64 `json:"endTime,omitempty"`
	Limit         *int   `json:"limit,omitempty"`
	NextToken     string `json:"nextToken,omitempty"`
	StartFromHead bool   `json:"startFromHead"`
	StartTime     *int64 `json:"startTime,omitempty"`
}

func NewGetLogEventsRequest

func NewGetLogEventsRequest() *GetLogEventsRequest

func (GetLogEventsRequest) DeMarshalResponse

func (req GetLogEventsRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (GetLogEventsRequest) Request

func (*GetLogEventsRequest) SetLimit

func (req *GetLogEventsRequest) SetLimit(limit int)

func (*GetLogEventsRequest) SetTimeRange

func (req *GetLogEventsRequest) SetTimeRange(start time.Time, end time.Time)

func (*GetLogEventsRequest) VerifyInput

func (req *GetLogEventsRequest) VerifyInput() error

type GetLogEventsResponse

type GetLogEventsResponse struct {
	NextBackwardToken string              `json:"nextBackwardToken"`
	NextForwardToken  string              `json:"nextForwardToken"`
	Events            []LogEventsResponse `json:"events"`
}

type GetMetricResultDatapoint

type GetMetricResultDatapoint struct {
	Timestamp   time.Time
	Unit        string
	Average     float64
	Sum         float64
	SampleCount float64
	Maximum     float64
	Minimum     float64
}

type GetMetricStatisticsRequest

type GetMetricStatisticsRequest struct {
	awsgo.RequestBuilder

	Dimensions []MetricDimensions
	EndTime    time.Time
	MetricName string
	Namespace  string
	Period     int
	StartTime  time.Time
	Statistics []string
	Unit       string
}

func NewGetMetricStatisticsRequest

func NewGetMetricStatisticsRequest() *GetMetricStatisticsRequest

func (GetMetricStatisticsRequest) DeMarshalResponse

func (gir GetMetricStatisticsRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (GetMetricStatisticsRequest) Request

func (*GetMetricStatisticsRequest) VerifyInput

func (gir *GetMetricStatisticsRequest) VerifyInput() error

type GetMetricStatisticsResponse

type GetMetricStatisticsResponse struct {
	ResponseMetadata          awsgo.ResponseMetaData
	GetMetricStatisticsResult GetMetricStatisticsResult
}

type GetMetricStatisticsResult

type GetMetricStatisticsResult struct {
	Label      string
	Datapoints []GetMetricResultDatapoint `xml:"Datapoints>member"`
}

type ListMetricsRequest

type ListMetricsRequest struct {
	awsgo.RequestBuilder

	Dimensions []MetricDimensions
	MetricName string
	Namespace  string
	NextToken  string
}

func NewListMetricsRequest

func NewListMetricsRequest() *ListMetricsRequest

func (ListMetricsRequest) DeMarshalResponse

func (req ListMetricsRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (ListMetricsRequest) Request

func (req ListMetricsRequest) Request() (*ListMetricsResponse, error)

func (*ListMetricsRequest) VerifyInput

func (req *ListMetricsRequest) VerifyInput() error

type ListMetricsResponse

type ListMetricsResponse struct {
	ResponseMetadata  awsgo.ResponseMetaData
	ListMetricsResult ListMetricsResult
}

type ListMetricsResult

type ListMetricsResult struct {
	NextToken string
	Metrics   []MetricInfo `xml:"Metrics>member"`
}

type LogEvents

type LogEvents struct {
	Message string `json:"message"`
	// in milliseconds
	Timestamp int64 `json:"timestamp"`
}

type LogEventsResponse

type LogEventsResponse struct {
	LogEvents
	IngestionTime int64 `json:"ingestionTime"`
}

type LogGroup

type LogGroup struct {
	Arn               string `json:"arn"`
	CreationTime      int64  `json:"creationTime"`
	LogGroupName      string `json:"logGroupName"`
	MetricFilterCount int64  `json:"metricFilterCount"`
	RetentionInDays   int64  `json:"retentionInDays"`
	StoredBytes       int64  `json:"storedBytes"`
}

type LogStream

type LogStream struct {
	Arn                 string `json:"arn"`
	CreationTime        int64  `json:"creationTime"`
	FirstEventTimestamp int64  `json:"firstEventTimestamp"`
	LastEventTimestamp  int64  `json:"lastEventTimestamp"`
	LastIngestionTime   int64  `json:"lastIngestionTime"`
	LogStreamName       string `json:"logStreamName"`
	StoredBytes         int64  `json:"storedBytes"`
	UploadSequenceToken string `json:"uploadSequenceToken"`
}

type MetricDatum

type MetricDatum struct {
	Dimensions      []MetricDimensions
	MetricName      string
	StatisticValues *StatisticSet
	Timestamp       *time.Time
	Unit            string
	Value           *float64
}

type MetricDimensions

type MetricDimensions struct {
	Name  string
	Value string
}

type MetricInfo

type MetricInfo struct {
	Dimensions []MetricDimensions `xml:"Dimensions>member"`
	MetricName string
	Namespace  string
}

type PutLogEventsRequest

type PutLogEventsRequest struct {
	awsgo.RequestBuilder

	LogGroupName  string      `json:"logGroupName"`
	LogStreamName string      `json:"logStreamName"`
	SequenceToken string      `json:"sequenceToken,omitempty"`
	LogEvents     []LogEvents `json:"logEvents"`
}

func NewPutLogEventsRequest

func NewPutLogEventsRequest() *PutLogEventsRequest

func (*PutLogEventsRequest) AddEvent

func (req *PutLogEventsRequest) AddEvent(message string, at time.Time)

func (PutLogEventsRequest) DeMarshalResponse

func (req PutLogEventsRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (PutLogEventsRequest) Request

events and entire content cannot be above 32,768 bytes. If you are unsure of your content size, use RequestSplit. It will use multiple requests to send your logs.

func (PutLogEventsRequest) RequestSplit

func (req PutLogEventsRequest) RequestSplit() (*PutLogEventsResponse, error)

func (*PutLogEventsRequest) VerifyInput

func (req *PutLogEventsRequest) VerifyInput() error

type PutLogEventsResponse

type PutLogEventsResponse struct {
	NextSequenceToken string `json:"nextSequenceToken"`
}

type PutMetricRequest

type PutMetricRequest struct {
	awsgo.RequestBuilder

	MetricData []MetricDatum
	Namespace  string
}

func NewPutMetricRequest

func NewPutMetricRequest() *PutMetricRequest

func (PutMetricRequest) DeMarshalResponse

func (gir PutMetricRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (PutMetricRequest) Request

func (gir PutMetricRequest) Request() (*PutMetricResponse, error)

func (*PutMetricRequest) VerifyInput

func (gir *PutMetricRequest) VerifyInput() error

type PutMetricResponse

type PutMetricResponse struct {
	ResponseMetadata awsgo.ResponseMetaData
}

type PutRetentionPolicyRequest

type PutRetentionPolicyRequest struct {
	awsgo.RequestBuilder

	LogGroupName    string `json:"logGroupName"`
	RetentionInDays int    `json:"retentionInDays"`
}

func NewPutRetentionPolicyRequest

func NewPutRetentionPolicyRequest() *PutRetentionPolicyRequest

func (PutRetentionPolicyRequest) DeMarshalResponse

func (req PutRetentionPolicyRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) interface{}

func (PutRetentionPolicyRequest) Request

func (*PutRetentionPolicyRequest) VerifyInput

func (req *PutRetentionPolicyRequest) VerifyInput() error

type PutRetentionPolicyResponse

type PutRetentionPolicyResponse struct {
}

type StatisticSet

type StatisticSet struct {
	Maximum     float64
	Minimum     float64
	SampleCount float64
	Sum         float64
}

Jump to

Keyboard shortcuts

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