Documentation ¶
Index ¶
- Variables
- func AddIntString(input string, value int) string
- func AllSame(elements [][]string, k int) bool
- func ArrayMetricToString(value string) string
- func Avg(input []float64) float64
- func CheckCert(certPath string, name string, configPath string, logger *slog.Logger)
- func CheckFreePorts(address string, ports []int) map[int]struct{}
- func EncodeURL(href string) (string, error)
- func FindLocalIP() (string, error)
- func GetCollectorSlice() []string
- func GetQueryParam(href string, query string) (string, error)
- func GetURLWithoutHost(r *http.Request) string
- func HandleArrayFormat(name string) string
- func HasDuplicates(slice []string) bool
- func Intersection(a []string, b []string) ([]string, []string)
- func IsPublicAPI(query string) bool
- func Max(input []float64) float64
- func MaxLen(elements [][]string) int
- func Min(input []float64) float64
- func MinLen(elements [][]string) int
- func ParseMetric(rawName string) (string, string, string, string)
- func ParseMetricType(metricName string) (string, string)
- func ParseZAPIDisplay(obj string, path []string) string
- func SafeConvertToInt32(in int) (int32, error)
- func SaveConfig(fp string, token string) error
- func SumNumbers(s []float64) float64
- func VersionAtLeast(currentVersion string, minVersion string) (bool, error)
- type Metadata
- type PollerStatus
- type Status
Constants ¶
This section is empty.
Variables ¶
var IsCollector = map[string]struct{}{
"ZapiPerf": {},
"Zapi": {},
"Rest": {},
"RestPerf": {},
"KeyPerf": {},
"Ems": {},
"StorageGrid": {},
"Unix": {},
"Simple": {},
}
var IsONTAPCollector = map[string]struct{}{
"ZapiPerf": {},
"Zapi": {},
"Rest": {},
"RestPerf": {},
"KeyPerf": {},
"Ems": {},
}
Functions ¶
func AddIntString ¶
func ArrayMetricToString ¶
func CheckFreePorts ¶
func FindLocalIP ¶
func GetCollectorSlice ¶
func GetCollectorSlice() []string
func GetURLWithoutHost ¶
func HandleArrayFormat ¶
func HasDuplicates ¶
func Intersection ¶
Intersection returns things from b that are common and missing with a
func IsPublicAPI ¶
IsPublicAPI returns false if api endpoint has private keyword in it else true
func Max ¶
Max returns 0 when passed an empty slice, slices.Max panics if input is empty, This function can be removed once all callers are checked for empty slices
func Min ¶
Min returns 0 when passed an empty slice, slices.Min panics if input is empty, This function can be removed once all callers are checked for empty slices
func ParseMetric ¶
ParseMetric parses display name and type of field and metric type from the raw name of the metric as defined in (sub)template. Users can rename a metric with "=>" (e.g., some_long_metric_name => short). Trailing "^" characters are ignored/cleaned as they have special meaning in some collectors.
func ParseMetricType ¶
func ParseZAPIDisplay ¶
func SafeConvertToInt32 ¶
func SaveConfig ¶
SaveConfig adds or updates the Grafana token in the harvest.yml config and saves it to fp. The Yaml marshaller is used so comments are preserved
func SumNumbers ¶
Types ¶
type PollerStatus ¶
type PollerStatus struct { Name string Status Status Pid int32 ProfilingPort string PromPort string }
func GetPollerStatuses ¶
func GetPollerStatuses() ([]PollerStatus, error)