Documentation
¶
Overview ¶
Package sqlservermetrics run SQL and OS collections and sends metrics to workload manager.
Index ¶
- Constants
- Variables
- func AgentFilePath() string
- func CollectionService(p string, collection func(cfg *configpb.Configuration, onetime bool) error, ...)
- func ConfigPath() string
- func Init() (*flags.AgentFlags, string, bool)
- func LoadConfiguration(path string) (*configpb.Configuration, error)
- func LogPrefix() string
- func LoggingSetup(ctx context.Context, logPrefix string, cfg *configpb.Configuration)
- func LoggingSetupDefault(ctx context.Context, prefix string)
- func OSCollection(ctx context.Context, path, logPrefix string, cfg *configpb.Configuration, ...) error
- func SQLCollection(ctx context.Context, path, logPrefix string, cfg *configpb.Configuration, ...) error
- func UsageMetricsLoggerInit(logName, logVersion, logPrefix string, logUsage bool) agentstatus.AgentStatus
- type CollectionType
- type InstanceProperties
Constants ¶
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 ¶
var UsageMetricsLogger agentstatus.AgentStatus = UsageMetricsLoggerInit(internal.ServiceName, internal.AgentVersion, internal.AgentUsageLogPrefix, true)
UsageMetricsLogger logs usage metrics.
Functions ¶
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 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 LoggingSetup ¶
func LoggingSetup(ctx context.Context, logPrefix string, cfg *configpb.Configuration)
LoggingSetup initialize the agent logging level.
func LoggingSetupDefault ¶
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.