Documentation ¶
Index ¶
- func AddToLabelMap(key string, value string, labelPath map[string]string)
- func Format(t *time.Time) string
- func FormatTime(mt model.Time) string
- func FormatTimeInSec(i int64) string
- func GetCsvHeaderFormat(entityKind string) (string, bool)
- func GetVersion(args *Parameters) (version string, err error)
- func GetWorkload(fileName, metricName, query string, metricField []model.LabelName, ...)
- func MetricCollect(args *Parameters, query string, range5m v1.Range) (value model.Value, err error)
- func TimeRange(args *Parameters, historyInterval time.Duration) (promRange v1.Range)
- func WriteWorkload(file io.Writer, result model.Value, metricField []model.LabelName, ...)
- type Parameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToLabelMap ¶
AddToLabelMap used to add values to label map used for attributes.
func FormatTime ¶
func FormatTimeInSec ¶
func GetCsvHeaderFormat ¶
func GetVersion ¶
func GetVersion(args *Parameters) (version string, err error)
func GetWorkload ¶
func GetWorkload(fileName, metricName, query string, metricField []model.LabelName, args *Parameters, entityKind string)
GetWorkload used to query for the workload data and then calls write workload
func MetricCollect ¶
MetricCollect is used to query Prometheus to get data for specific query and return the results to be processed.
func TimeRange ¶
func TimeRange(args *Parameters, historyInterval time.Duration) (promRange v1.Range)
TimeRange allows you to define the start and end values of the range will pass to the Prometheus for the query.
func WriteWorkload ¶
func WriteWorkload(file io.Writer, result model.Value, metricField []model.LabelName, args *Parameters, entityKind string)
WriteWorkload will write out the workload data specific to metric provided to the file that was passed in.
Types ¶
type Parameters ¶
type Parameters struct {
ClusterName, PromURL, PromAddress, FileName, Interval *string
IntervalSize, History, Offset *int
Debug bool
CurrentTime *time.Time
LabelSuffix string
InfoLogger, WarnLogger, ErrorLogger, DebugLogger *log.Logger
SampleRate int
SampleRateString, NodeGroupList string
OAuthTokenPath string
CaCertPath string
Deployments, CronJobs bool
}
Parameters - Reusable structure that holds common arguments used in the project
Click to show internal directories.
Click to hide internal directories.