Documentation ¶
Index ¶
- Constants
- Variables
- func BuildStatsKey(nodeType NodeType) string
- func ChunkRange(numberOfElements, chunkCount, chunkSize, counter int) (int, int)
- func GroupSize(msgs, maxPerMessage int) int
- func SkipKubernetesResource(uid types.UID, resourceVersion string, nodeType NodeType) bool
- type CheckStats
- type NodeType
Constants ¶
const ( // NoExpiration maps to go-cache corresponding value NoExpiration = cache.NoExpiration // ClusterAgeCacheKey is the key name for the orchestrator cluster age in the agent in-mem cache ClusterAgeCacheKey = "orchestratorClusterAge" )
Variables ¶
var CheckName = "orchestrator"
CheckName is the cluster check name of the orchestrator check
var (
// KubernetesResourceCache provides an in-memory key:value store similar to memcached for kubernetes resources.
KubernetesResourceCache = cache.New(defaultExpire, defaultPurge)
)
Functions ¶
func BuildStatsKey ¶
BuildStatsKey builds a orchestrator statsKey prefixed key.
func ChunkRange ¶
ChunkRange returns the chunk start and end for an iteration.
func SkipKubernetesResource ¶
SkipKubernetesResource checks with a global kubernetes cache whether the resource was already reported. It will return true in case the UID is in the cache and the resourceVersion did not change. Else it will return false. 0 == defaultDuration
Types ¶
type CheckStats ¶
type CheckStats struct { // CacheHits contains the number of cache hits for a NodeType per run. CacheHits int // CacheMiss contains the number of cache miss/send Data for a NodeType per run. CacheMiss int NodeType }
CheckStats holds statistics for the DCA status command regarding the last run check. Information is saved in the KubernetesResourceCache.
type NodeType ¶
type NodeType int
NodeType represents a kind of resource used by a container orchestrator.
const ( // K8sDeployment represents a Kubernetes Deployment K8sDeployment NodeType = iota // K8sPod represents a Kubernetes Pod K8sPod // K8sReplicaSet represents a Kubernetes ReplicaSet K8sReplicaSet // K8sService represents a Kubernetes Service K8sService // K8sNode represents a Kubernetes Node K8sNode // K8sCluster represents a Kubernetes Cluster K8sCluster // K8sJob represents a Kubernetes Job K8sJob // K8sCronJob represents a Kubernetes CronJob K8sCronJob // K8sDaemonSet represents a Kubernetes DaemonSet K8sDaemonSet // K8sStatefulSet represents a Kubernetes StatefulSet K8sStatefulSet // K8sPersistentVolume represents a Kubernetes PersistentVolume K8sPersistentVolume // K8sPersistentVolumeClaim represents a Kubernetes PersistentVolumeClaim K8sPersistentVolumeClaim // K8sRole represents a Kubernetes Role K8sRole // K8sRoleBinding represents a Kubernetes RoleBinding K8sRoleBinding // K8sClusterRole represents a Kubernetes ClusterRole K8sClusterRole // K8sClusterRoleBinding represents a Kubernetes ClusterRoleBinding K8sClusterRoleBinding // K8sServiceAccount represents a Kubernetes ServiceAccount K8sServiceAccount )
func NodeTypes ¶
func NodeTypes() []NodeType
NodeTypes returns the current existing NodesTypes as a slice to iterate over.
func (NodeType) Orchestrator ¶
Orchestrator returns the orchestrator name for a node type.
func (NodeType) TelemetryTags ¶
TelemetryTags return tags used for telemetry.