workloadmanager

package
v0.0.0-...-7370a3d Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package workloadmanager collects workload manager metrics and sends them to Data Warehouse.

Index

Constants

View Source
const MetricOverridePath = "/etc/google-cloud-workload-agent/wlmmetricoverride.yaml"

MetricOverridePath is the path to the metric override file.

Variables

This section is empty.

Functions

func QuietSendDataInsight

func QuietSendDataInsight(ctx context.Context, params SendDataInsightParams) (*wlm.WriteInsightResponse, error)

QuietSendDataInsight sends a data insight to Data Warehouse without logging. This is used for the data warehouse activation check.

func SendDataInsight

func SendDataInsight(ctx context.Context, params SendDataInsightParams) (*wlm.WriteInsightResponse, error)

SendDataInsight sends a data insight to Data Warehouse.

Types

type ConfigFileReader

type ConfigFileReader func(string) (io.ReadCloser, error)

ConfigFileReader is a function that reads a config file.

type SendDataInsightParams

type SendDataInsightParams struct {
	WLMetrics  WorkloadMetrics
	CloudProps *cpb.CloudProperties
	WLMService WLMWriter
}

SendDataInsightParams defines the set of parameters required to call SendDataInsight

type Service

type Service struct {
	Config *cpb.Configuration
	Client WLMWriter
}

Service is used to collect workload manager metrics and send them to Data Warehouse.

func (*Service) CollectAndSendMetricsToDataWarehouse

func (s *Service) CollectAndSendMetricsToDataWarehouse(ctx context.Context, a any)

CollectAndSendMetricsToDataWarehouse collects workload metrics and sends them to Data Warehouse.

type WLMWriter

type WLMWriter interface {
	WriteInsightAndGetResponse(project, location string, writeInsightRequest *dwpb.WriteInsightRequest) (*wlm.WriteInsightResponse, error)
}

WLMWriter is an interface for writing insights to Data Warehouse.

func Client

func Client(ctx context.Context, config *cpb.Configuration) (WLMWriter, error)

Client creates a new WLM client.

type WorkloadMetrics

type WorkloadMetrics struct {
	WorkloadType WorkloadType
	Metrics      map[string]string
}

WorkloadMetrics is a struct that collect data from override configuration file for testing purposes. Future enhancements will include the collection of actual WLM metrics.

type WorkloadType

type WorkloadType string

WorkloadType is an enum for the type of workload.

const (
	// UNKNOWN  workload type.
	UNKNOWN WorkloadType = "UNKNOWN"
	// ORACLE workload type.
	ORACLE WorkloadType = "ORACLE"
	// MYSQL workload type.
	MYSQL WorkloadType = "MYSQL"
	// REDIS workload type.
	REDIS WorkloadType = "REDIS"
	// POSTGRES workload type.
	POSTGRES WorkloadType = "POSTGRES"
	// MONGODB workload type.
	MONGODB WorkloadType = "MONGODB"
)

Jump to

Keyboard shortcuts

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