sqlservermetrics

package
v0.0.0-...-11ca375 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package sqlservermetrics run SQL and OS collections and sends metrics to workload manager.

Index

Constants

View Source
const (
	// ServiceName .
	ServiceName = internal.ServiceName
	// ServiceDisplayName .
	ServiceDisplayName = "Google Cloud Agent for SQL Server"
	// Description .
	Description = "Google Cloud Agent for SQL Server."
	// ExperimentalMode .
	ExperimentalMode = internal.ExperimentalMode
	// AgentUsageLogPrefix .
	AgentUsageLogPrefix = internal.AgentUsageLogPrefix
	// AgentVersion .
	AgentVersion = internal.AgentVersion
)

Variables

UsageMetricsLogger logs usage metrics.

Functions

func AgentFilePath

func AgentFilePath() string

AgentFilePath is the agent file path for linux.

func CollectionService

func CollectionService(p string, collection func(cfg *configpb.Configuration, onetime bool) error, collectionType CollectionType)

CollectionService runs the passed in collection as a service.

func ConfigPath

func ConfigPath() string

ConfigPath is the config path for linux.

func Init

func Init() (*flags.AgentFlags, string, bool)

Init parses flags and execute if certain flags are enabled.

func LoadConfiguration

func LoadConfiguration(path string) (*configpb.Configuration, error)

LoadConfiguration loads configuration from given path.

func LogPrefix

func LogPrefix() string

LogPrefix is the log prefix for linux.

func LoggingSetup

func LoggingSetup(ctx context.Context, logPrefix string, cfg *configpb.Configuration)

LoggingSetup initialize the agent logging level.

func LoggingSetupDefault

func LoggingSetupDefault(ctx context.Context, prefix string)

LoggingSetupDefault wraps LoggingSetupDefault function from agent_shared.go.

func OSCollection

func OSCollection(ctx context.Context, path, logPrefix string, cfg *configpb.Configuration, onetime bool) error

OSCollection is the linux implementation of OSCollection.

func SQLCollection

func SQLCollection(ctx context.Context, path, logPrefix string, cfg *configpb.Configuration, onetime bool) error

SQLCollection is the linux implementation of SQLCollection.

func UsageMetricsLoggerInit

func UsageMetricsLoggerInit(logName, logVersion, logPrefix string, logUsage bool) agentstatus.AgentStatus

UsageMetricsLoggerInit initializes and returns usage metrics logger.

Types

type CollectionType

type CollectionType int

CollectionType represents the enums of collection types.

const (
	// OS collection type.
	OS CollectionType = iota
	// SQL collection type.
	SQL
)

type InstanceProperties

type InstanceProperties struct {
	Name          string
	Instance      string
	InstanceID    string
	ProjectID     string
	ProjectNumber string
	Zone          string
	Image         string
}

InstanceProperties represents properties of instance.

var SIP InstanceProperties = sourceInstanceProperties()

SIP is the source instance properties.

Jump to

Keyboard shortcuts

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