workers

package
v0.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DRILL_DOWN_URL_TEMPLATE string = "%s#/location=ANALYTICS_ADQL_SEARCH&searchId=%d"
	BASE_PATH               string = "Application Infrastructure Performance|%s|Custom Metrics|Cluster Stats|"
)
View Source
const (
	AGENT_EVENT_SECRET string = "appd-event-secret"
	AGENT_EVENT_KEY    string = "apikey"
)
View Source
const (
	WIDGET_GAP      float64 = 10
	FULL_CLUSTER    string  = "/cluster-template.json"
	CLUSTER_WIDGETS string  = "/cluster-widgets.json"
	DEPLOY_BASE     string  = "/base_deploy_template.json"
	TIER_SUMMARY    string  = "/tier_stats_widget.json"
	BACKGROUND      string  = "/background.json"
	HEAT_MAP        string  = "/heatnodetemplate.json"
	HEAT_WIDGET     string  = "/healthwidget.json"
)

Variables

This section is empty.

Functions

func EmitInstrumentationEvent

func EmitInstrumentationEvent(pod *v1.Pod, client *kubernetes.Clientset, reason, message, eventType string) error

custom events

func ReverseDeploymentInstrumentation

func ReverseDeploymentInstrumentation(deployName string, namespace string, agentRequests *m.AgentRequestList, removeAnnotations bool, bag *m.AppDBag, l *log.Logger, client *kubernetes.Clientset)

Types

type AdqlSearchWorker

type AdqlSearchWorker struct {
	Bag         *m.AppDBag
	SearchCache map[string]m.AdqlSearch
	Logger      *log.Logger
}

func NewAdqlSearchWorker

func NewAdqlSearchWorker(bag *m.AppDBag, l *log.Logger) AdqlSearchWorker

func (*AdqlSearchWorker) CacheSearches

func (aw *AdqlSearchWorker) CacheSearches() error

func (*AdqlSearchWorker) CreateSearch

func (aw *AdqlSearchWorker) CreateSearch(searchObj *m.AdqlSearch) (*m.AdqlSearch, error)

func (*AdqlSearchWorker) DeleteSearch

func (aw *AdqlSearchWorker) DeleteSearch(searchID int) error

func (*AdqlSearchWorker) GetSearch

func (aw *AdqlSearchWorker) GetSearch(metricPath string) string

type DaemonWorker

type DaemonWorker struct {
	Client         *kubernetes.Clientset
	ConfigManager  *config.MutexConfigManager
	SummaryMap     map[string]m.ClusterDaemonMetrics
	WQ             workqueue.RateLimitingInterface
	AppdController *app.ControllerClient
	PendingCache   []string
	FailedCache    map[string]m.AttachStatus
	Logger         *log.Logger
	// contains filtered or unexported fields
}

func NewDaemonWorker

func NewDaemonWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, controller *app.ControllerClient, l *log.Logger) DaemonWorker

func (*DaemonWorker) Observe

func (dw *DaemonWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

type DashboardWorker

type DashboardWorker struct {
	Bag            *m.AppDBag
	Logger         *log.Logger
	AppdController *app.ControllerClient
	AdqlWorker     AdqlSearchWorker
}

func NewDashboardWorker

func NewDashboardWorker(bag *m.AppDBag, l *log.Logger, appController *app.ControllerClient) DashboardWorker

func (*DashboardWorker) DeleteDashboard

func (dw *DashboardWorker) DeleteDashboard(id int) error

func (*DashboardWorker) GetEntityInfo

func (dw *DashboardWorker) GetEntityInfo(widget *map[string]interface{}, dashBag *m.DashboardBag) (string, string)

type DeployWorker

type DeployWorker struct {
	Client         *kubernetes.Clientset
	ConfigManager  *config.MutexConfigManager
	SummaryMap     map[string]m.ClusterDeployMetrics
	WQ             workqueue.RateLimitingInterface
	AppdController *app.ControllerClient
	PendingCache   []string
	FailedCache    map[string]m.AttachStatus
	Logger         *log.Logger
	// contains filtered or unexported fields
}

func NewDeployWorker

func NewDeployWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, controller *app.ControllerClient, l *log.Logger) DeployWorker

func (*DeployWorker) Observe

func (dw *DeployWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

type EventWorker

type EventWorker struct {
	Client         *kubernetes.Clientset
	ConfigManager  *config.MutexConfigManager
	SummaryMap     map[string]m.ClusterEventMetrics
	WQ             workqueue.RateLimitingInterface
	AppdController *app.ControllerClient
	PodsWorker     *PodWorker
	Logger         *log.Logger
	// contains filtered or unexported fields
}

func NewEventWorker

func NewEventWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, appdController *app.ControllerClient, podsWorker *PodWorker, l *log.Logger) EventWorker

func (*EventWorker) GetEventCategory

func (ew *EventWorker) GetEventCategory(eventSchema *m.EventSchema) (string, string)

func (*EventWorker) HasSynced

func (ew *EventWorker) HasSynced() bool

func (*EventWorker) Observe

func (ew *EventWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

type JobsWorker

type JobsWorker struct {
	Client         *kubernetes.Clientset
	ConfigManager  *config.MutexConfigManager
	SummaryMap     map[string]m.ClusterJobMetrics
	WQ             workqueue.RateLimitingInterface
	AppdController *app.ControllerClient
	K8sConfig      *rest.Config
	Logger         *log.Logger
	// contains filtered or unexported fields
}

func NewJobsWorker

func NewJobsWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, controller *app.ControllerClient, config *rest.Config, l *log.Logger) JobsWorker

func (*JobsWorker) HasSynced

func (pw *JobsWorker) HasSynced() bool

func (JobsWorker) Observe

func (pw JobsWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

type MainController

type MainController struct {
	ConfManager    *config.MutexConfigManager
	K8sClient      *kubernetes.Clientset
	Logger         *log.Logger
	K8sConfig      *rest.Config
	PodsWorker     *PodWorker
	NodesWorker    *NodesWorker
	AppdController *app.ControllerClient
}

func NewController

func NewController(cm *config.MutexConfigManager, client *kubernetes.Clientset, l *log.Logger, config *rest.Config) MainController

func (*MainController) EnsureEventAPIKey

func (c *MainController) EnsureEventAPIKey(bag *m.AppDBag) (string, error)

func (*MainController) Run

func (c *MainController) Run(stopCh <-chan struct{}, wg *sync.WaitGroup)

func (*MainController) ValidateParameters

func (c *MainController) ValidateParameters() error

type NodesWorker

type NodesWorker struct {
	Client         *kubernetes.Clientset
	ConfigManager  *config.MutexConfigManager
	SummaryMap     map[string]m.ClusterNodeMetrics
	WQ             workqueue.RateLimitingInterface
	AppdController *app.ControllerClient
	CapacityMap    map[string]m.NodeSchema
	Logger         *log.Logger
	// contains filtered or unexported fields
}

func NewNodesWorker

func NewNodesWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, controller *app.ControllerClient, l *log.Logger) NodesWorker

func (*NodesWorker) GetNodeData

func (pw *NodesWorker) GetNodeData(nodeName string) *m.NodeSchema

func (NodesWorker) GetNodeMetricsSingle

func (pw NodesWorker) GetNodeMetricsSingle(podName string) *m.NodeMetricsObj

func (*NodesWorker) HasSynced

func (pw *NodesWorker) HasSynced() bool

func (NodesWorker) Observe

func (pw NodesWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

type PodWorker

type PodWorker struct {
	Client                  *kubernetes.Clientset
	ConfManager             *config.MutexConfigManager
	Logger                  *log.Logger
	SummaryMap              map[string]m.ClusterPodMetrics
	AppSummaryMap           map[string]m.ClusterAppMetrics
	ContainerSummaryMap     map[string]m.ClusterContainerMetrics
	InstanceSummaryMap      map[string]m.ClusterInstanceMetrics
	WQ                      workqueue.RateLimitingInterface
	AppdController          *app.ControllerClient
	K8sConfig               *rest.Config
	PendingCache            []string
	FailedCache             map[string]m.AttachStatus
	ServiceCache            map[string]m.ServiceSchema
	EndpointCache           map[string]v1.Endpoints
	RQCache                 map[string]v1.ResourceQuota
	PVCCache                map[string]v1.PersistentVolumeClaim
	CMCache                 map[string]v1.ConfigMap
	SecretCache             map[string]v1.Secret
	NSCache                 map[string]m.NsSchema
	OwnerMap                map[string]string
	NamespaceMap            map[string]string
	ServiceWatcher          *w.ServiceWatcher
	EndpointWatcher         *w.EndpointWatcher
	PVCWatcher              *w.PVCWatcher
	RQWatcher               *w.RQWatcher
	CMWatcher               *w.ConfigWatcher
	NSWatcher               *w.NSWatcher
	SecretWatcher           *w.SecretWathcer
	DashboardCache          map[string]m.PodSchema
	DelayDashboard          bool
	PendingAssociationQueue map[string]m.AgentRetryRequest
	EventMap                map[string][]m.EventSchema
	NodesMonitor            *NodesWorker
	ContainerCache          map[string]m.ContainerSchema
	// contains filtered or unexported fields
}

func NewPodWorker

func NewPodWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, controller *app.ControllerClient, config *rest.Config, l *log.Logger, nw *NodesWorker) PodWorker

func (PodWorker) CacheUpdated

func (pw PodWorker) CacheUpdated(namespace string)

func (PodWorker) CheckPort

func (pw PodWorker) CheckPort(port *v1.ContainerPort, podObj *v1.Pod, podSchema *m.PodSchema) *m.ContainerPort

func (*PodWorker) GetCachedPod

func (pw *PodWorker) GetCachedPod(namespace string, podName string) (*v1.Pod, string, error)

func (*PodWorker) GetCpuConsumption

func (pw *PodWorker) GetCpuConsumption(podSchema *m.PodSchema, containerSchema *m.ContainerSchema) (float64, string)

func (*PodWorker) GetKnownDeployments

func (pw *PodWorker) GetKnownDeployments() map[string]string

func (*PodWorker) GetKnownNamespaces

func (pw *PodWorker) GetKnownNamespaces() map[string]string

func (*PodWorker) GetMemConsumption

func (pw *PodWorker) GetMemConsumption(podSchema *m.PodSchema, containerSchema *m.ContainerSchema) (float64, string)

func (*PodWorker) GetPodEvents

func (pw *PodWorker) GetPodEvents(podSchema *m.PodSchema) []string

func (PodWorker) GetPodMetrics

func (pw PodWorker) GetPodMetrics() *map[string]m.UsageStats

func (PodWorker) GetPodMetricsSingle

func (pw PodWorker) GetPodMetricsSingle(p *v1.Pod, namespace string, podName string) *m.PodMetricsObj

func (*PodWorker) GetPodUtilization

func (pw *PodWorker) GetPodUtilization(podSchema *m.PodSchema) map[string]m.Utilization

func (*PodWorker) HasSynced

func (pw *PodWorker) HasSynced() bool

func (PodWorker) Observe

func (pw PodWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

func (*PodWorker) OnPodErrorEvent

func (pw *PodWorker) OnPodErrorEvent(podName string, eventSchema m.EventSchema)

type RsWorker

type RsWorker struct {
	Client         *kubernetes.Clientset
	ConfigManager  *config.MutexConfigManager
	SummaryMap     map[string]m.ClusterRsMetrics
	WQ             workqueue.RateLimitingInterface
	AppdController *app.ControllerClient
	PendingCache   []string
	FailedCache    map[string]m.AttachStatus
	Logger         *log.Logger
	// contains filtered or unexported fields
}

func NewRsWorker

func NewRsWorker(client *kubernetes.Clientset, cm *config.MutexConfigManager, controller *app.ControllerClient, l *log.Logger) RsWorker

func (*RsWorker) Observe

func (dw *RsWorker) Observe(stopCh <-chan struct{}, wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL