Documentation ¶
Index ¶
- Constants
- Variables
- func Average(x []float64) float64
- func Clamp(min, x, max int) int
- func FromCatalog(s string) bool
- func GetAppCatalogState(c *CollectorOpts, id string) (string, error)
- func GetCPU(item string) int
- func GetClusterClient(c *CollectorOpts, id string) (*rancherCluster.Client, error)
- func GetMem(item, unit string) int64
- func GetMemMb(item string) int
- func GetProjectClient(c *CollectorOpts, id string) (*rancherProject.Client, error)
- func GetRawInt(item, sep string) int
- func GetRawInt64(item, sep string) int64
- func GetTelemetryUid(c *CollectorOpts) (string, bool)
- func IsNotFound(err error) bool
- func Max(x, y int) int
- func Min(x, y int) int
- func MinButNotZero(x, y int) int
- func NonRemoved() norman.ListOpts
- func Register(c Collector)
- func Round(f float64) int
- func Run(record *record.Record, opt *CollectorOpts)
- func SetSetting(client *rancher.Client, key string, value string) error
- func SplitAppExternalID(externalID string) (map[string]string, error)
- func SplitExternalID(externalID string) (string, string, string, error)
- func SplitMultiClusterAppExternalID(externalID string) (map[string]string, error)
- type App
- type AppTemplate
- type Cluster
- type ClusterTemplate
- type Collector
- type CollectorOpts
- type CpuInfo
- type HPAInfo
- type Installation
- type LabelCount
- type MemoryInfo
- type MultiClusterApp
- type Node
- type NsInfo
- type PipelineInfo
- type PodData
- type PodInfo
- type Project
- type WorkloadInfo
Constants ¶
View Source
const ( AppTemplateExternalIDPrefix = "catalog://?" AppCatalogLibrary = "library" AppCatalogSystemLibrary = "system-library" )
View Source
const ( TELEMETRY_UID_SETTING = "telemetry-uid" SERVER_VERSION_SETTING = "server-version" UI_DEFAULT_LANDING_SETTING = "ui-default-landing" UI_LANDING_EXPLORER = "vue" UI_LANDING_MANAGER = "ember" UI_LANDING_DEFAULT = UI_LANDING_MANAGER )
Variables ¶
View Source
var ( AppRancherCatalogs = []string{AppCatalogLibrary, AppCatalogSystemLibrary} AppGetProjectClient = GetProjectClient )
View Source
var ( ClusterClients = map[string]*rancherCluster.Client{} ProjectClients = map[string]*rancherProject.Client{} NewRancherClusterClient = rancherCluster.NewClient NewRancherProjectClient = rancherProject.NewClient )
View Source
var ( ClusterGetClusterClient = GetClusterClient ClusterGetProjectClient = GetProjectClient )
View Source
var ( ProjectGetClusterClient = GetClusterClient ProjectGetProjectClient = GetProjectClient )
Functions ¶
func FromCatalog ¶
func GetAppCatalogState ¶ added in v0.5.12
func GetAppCatalogState(c *CollectorOpts, id string) (string, error)
func GetClusterClient ¶ added in v0.5.12
func GetClusterClient(c *CollectorOpts, id string) (*rancherCluster.Client, error)
func GetProjectClient ¶ added in v0.5.12
func GetProjectClient(c *CollectorOpts, id string) (*rancherProject.Client, error)
func GetRawInt64 ¶
func GetTelemetryUid ¶ added in v0.5.12
func GetTelemetryUid(c *CollectorOpts) (string, bool)
func IsNotFound ¶ added in v0.5.12
func MinButNotZero ¶
func NonRemoved ¶
func Run ¶
func Run(record *record.Record, opt *CollectorOpts)
func SplitAppExternalID ¶ added in v0.5.12
func SplitExternalID ¶ added in v0.5.8
Types ¶
type App ¶ added in v0.5.12
type App struct { Total int `json:"total"` Active int `json:"active"` Catalogs map[string]*AppTemplate `json:"rancheCatalogs"` }
func (App) Collect ¶ added in v0.5.12
func (a App) Collect(c *CollectorOpts) interface{}
type AppTemplate ¶ added in v0.5.12
type AppTemplate struct { State string `json:"state"` Apps map[string]*LabelCount `json:"apps"` }
type Cluster ¶
type Cluster struct { Active int `json:"active"` Total int `json:"total"` Ns *NsInfo `json:"namespace"` Cpu *CpuInfo `json:"cpu"` Mem *MemoryInfo `json:"mem"` Pod *PodInfo `json:"pod"` Driver LabelCount `json:"driver"` IstioTotal int `json:"istio"` MonitoringTotal int `json:"monitoring"` LogProviderCount LabelCount `json:"logging"` CloudProvider LabelCount `json:"cloudProvider"` }
func (Cluster) Collect ¶
func (h Cluster) Collect(c *CollectorOpts) interface{}
type ClusterTemplate ¶ added in v0.5.7
type ClusterTemplate struct { TotalClusterTemplates int `json:"total"` TotalTemplateRevisions int `json:"revisions"` Enforcement string `json:"enforcement"` }
func (ClusterTemplate) Collect ¶ added in v0.5.7
func (ct ClusterTemplate) Collect(c *CollectorOpts) interface{}
func (ClusterTemplate) RecordKey ¶ added in v0.5.7
func (ct ClusterTemplate) RecordKey() string
type Collector ¶
type Collector interface { RecordKey() string Collect(opt *CollectorOpts) interface{} }
type CollectorOpts ¶
type CpuInfo ¶
type HPAInfo ¶ added in v0.5.7
type Installation ¶
type Installation struct { Uid string `json:"uid"` Version string `json:"version"` UiLanding string `json:"uiLanding"` AuthConfig LabelCount `json:"auth"` Users LabelCount `json:"users"` KontainerDriverCount int `json:"kontainerDriverCount"` KontainerDrivers LabelCount `json:"kontainerDrivers"` NodeDriverCount int `json:"nodeDriverCount"` NodeDrivers LabelCount `json:"nodeDrivers"` HasInternal bool `json:"hasInternal"` }
func (Installation) Collect ¶
func (i Installation) Collect(c *CollectorOpts) interface{}
func (*Installation) GetUILanding ¶ added in v0.5.13
func (i *Installation) GetUILanding(c *CollectorOpts)
func (*Installation) GetUid ¶
func (i *Installation) GetUid(c *CollectorOpts)
func (*Installation) GetVersion ¶ added in v0.5.12
func (i *Installation) GetVersion(c *CollectorOpts)
func (Installation) RecordKey ¶
func (i Installation) RecordKey() string
type LabelCount ¶
func (*LabelCount) Increment ¶
func (m *LabelCount) Increment(k string)
type MemoryInfo ¶
type MemoryInfo struct { MinMb int `json:"mb_min"` MaxMb int `json:"mb_max"` TotalMb int `json:"mb_total"` UtilMin int `json:"util_min"` UtilAvg int `json:"util_avg"` UtilMax int `json:"util_max"` }
func (*MemoryInfo) Update ¶
func (m *MemoryInfo) Update(total, util int)
func (*MemoryInfo) UpdateAvg ¶
func (m *MemoryInfo) UpdateAvg(i []float64)
type MultiClusterApp ¶ added in v0.5.5
type MultiClusterApp struct { Total int `json:"total"` Active int `json:"active"` TargetMin int `json:"targetMin"` TargetMax int `json:"targetMax"` TargetAvg float64 `json:"targetAvg"` TargetTotal int `json:"targetTotal"` DnsProviders int `json:"dnsProviders"` DnsEntries int `json:"dnsEntries"` Catalogs map[string]*AppTemplate `json:"rancheCatalogs"` }
func (MultiClusterApp) Collect ¶ added in v0.5.5
func (mca MultiClusterApp) Collect(c *CollectorOpts) interface{}
func (MultiClusterApp) RecordKey ¶ added in v0.5.5
func (mca MultiClusterApp) RecordKey() string
type Node ¶
type Node struct { Active int `json:"active"` Imported int `json:"imported"` FromTmpl int `json:"from_template"` Total int `json:"total"` Cpu CpuInfo `json:"cpu"` Mem MemoryInfo `json:"mem"` Pod PodInfo `json:"pod"` Kernel LabelCount `json:"kernel"` Kubelet LabelCount `json:"kubelet"` Kubeproxy LabelCount `json:"kubeproxy"` Os LabelCount `json:"os"` Docker LabelCount `json:"docker"` Driver LabelCount `json:"driver"` Role LabelCount `json:"role"` }
func (Node) Collect ¶
func (h Node) Collect(c *CollectorOpts) interface{}
type NsInfo ¶
type NsInfo struct { NsMin int `json:"min"` NsMax int `json:"max"` NsTotal int `json:"total"` NsAvg int `json:"avg"` FromCatalog int `json:"from_catalog,omitempty"` NoProject int `json:"no_project,omitempty"` }
func (*NsInfo) UpdateDetails ¶
type PipelineInfo ¶ added in v0.5.7
type PipelineInfo struct { Enabled int `json:"enabled"` // 1 if user has any # pipeline provider enabled SourceProvider LabelCount `json:"source"` TotalPipelines int `json:"total"` }
type PodData ¶
type PodInfo ¶
type Project ¶
type Project struct { Total int `json:"total"` Ns NsInfo `json:"namespace"` Workload WorkloadInfo `json:"workload"` Pipeline PipelineInfo `json:"pipeline"` LibraryCharts LabelCount `json:"charts"` HPA HPAInfo `json:"hpa"` Pod PodData `json:"pod"` Orchestration LabelCount `json:"orch"` }
func (Project) Collect ¶
func (p Project) Collect(c *CollectorOpts) interface{}
type WorkloadInfo ¶
type WorkloadInfo struct { WorkloadMin int `json:"min"` WorkloadMax int `json:"max"` WorkloadTotal int `json:"total"` WorkloadAvg int `json:"avg"` }
func (*WorkloadInfo) Update ¶
func (w *WorkloadInfo) Update(i int)
func (*WorkloadInfo) UpdateAvg ¶
func (w *WorkloadInfo) UpdateAvg(i []float64)
Click to show internal directories.
Click to hide internal directories.