Documentation ¶
Overview ¶
Package metrics provides functionality for processing Percona Pillar's metrics.
Index ¶
Constants ¶
const (
// InstanceIDKey key name in telemetryFile with host instance ID.
InstanceIDKey = "instanceId"
)
Variables ¶
This section is empty.
Functions ¶
func CleanupMetricsHistory ¶
CleanupMetricsHistory removes all telemetry files from history directory that are older than threshold. File creation time is taken from file name - it contains unixtime in format: <unixtime>-<random token>.json.
func WriteMetricsToHistory ¶
func WriteMetricsToHistory(historyFile string, platformReport *platformReporter.ReportRequest) error
WriteMetricsToHistory creates a new telemetry history file and writes the content of Percona Platform telemetry request into it. Content is written using JSON format.
Types ¶
type File ¶
type File struct { Filename string Timestamp time.Time ProductFamily platformReporter.ProductFamily Metrics map[string]string }
File struct used for storing parsed Pillar's or host metrics. One object hold info about of metrics file.
func ProcessPGMetrics ¶
ProcessPGMetrics processes PG metrics and returns slice of *File. Each File corresponds to a separate metrics file.
func ProcessPSMDBMetrics ¶
ProcessPSMDBMetrics processes PSMDB metrics and returns slice of *File. Each File corresponds to a separate metrics file.
func ProcessPSMetrics ¶
ProcessPSMetrics processes PS metrics and returns slice of *File. Each File corresponds to a separate metrics file.
func ProcessPXCMetrics ¶
ProcessPXCMetrics processes PXC metrics and returns slice of *File. Each File corresponds to a separate metrics file.
func ScrapeHostMetrics ¶
ScrapeHostMetrics gathers metrics about host where Telemetry Agent is running. In addition, it checks Percona telemetry file and extracts instanceId value from it.
type Package ¶
type Package struct { Name string `json:"name"` Version string `json:"version"` Repository PackageRepository `json:"repository"` }
Package represents a software package with its name and version.
func ScrapeInstalledPackages ¶
ScrapeInstalledPackages scrapes the installed packages on the host and returns a slice of Package structs along with any errors encountered. The function uses the localOS variable to determine the package manager to use.
type PackageRepository ¶
PackageRepository represents a repository where a software package is located.