Documentation ¶
Overview ¶
Copyright © 2020 Christian González Di Antonio christian@slashdevops.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTimeStamps ¶
func GetTimeStamps(t time.Time, p string, tg string) (startTime time.Time, endTime time.Time, period time.Duration)
Return the necessary inputs for function NewGetMetricDataInput
points period now() ↓ ↓→ ←↓ ↓
[(startTime)............................(endTime)] → time
https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricStat.html this function calculate the right startTime, endTime and period from a time.Time and string period as a parameter using the p (period as string) and the t (time.Time) this function calculate the startTime and endTime as a multiple of the period. The startTime is the oldest time and multiple of the period The endTime is the newest time (future) and multiple of the period The period is a time.Duration representation of the p string passed as function arg
Types ¶
type Metrics ¶
type Metrics interface { // Used to assemble the AWS GetMetricDataInput data structure GetMetricDataInput(time.Time, time.Time, time.Duration, string) *cloudwatch.GetMetricDataInput // GetMetricDesc(id string) *prometheus.Desc GetMetricsDesc() map[string]*prometheus.Desc }