tracker

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tracker contains logic of service stats persistence. This is for the sake of making graphs for README.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BackendFile   *ConfigBackendFile   `json:"backend_file"`
	BackendMemory *ConfigBackendMemory `json:"backend_memory"`
	Period        duration.Duration    `json:"period"`
}

Config is a configuration of a tracker.

func (*Config) Prepare

func (c *Config) Prepare() error

Prepare validates config.

type ConfigBackendFile added in v0.0.2

type ConfigBackendFile struct {
	Path string `json:"path"`
}

ConfigBackendFile configures file backend of a Tracker.

func (*ConfigBackendFile) Prepare added in v0.0.2

func (c *ConfigBackendFile) Prepare() error

Prepare validates config.

type ConfigBackendMemory added in v0.0.2

type ConfigBackendMemory struct {
}

ConfigBackendMemory configures memory backend of a Tracker.

type Report added in v0.0.2

type Report struct {
	Timestamp   string
	RSS         uint64
	Utilization float64
	GOGC        int
	Throttling  uint32
}

Report is a memory consumption report (used only for tests).

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker is responsible for service stats persistence.

func NewTrackerFromConfig

func NewTrackerFromConfig(logger logr.Logger, cfg *Config, memLimiter memlimiter.Service) (*Tracker, error)

NewTrackerFromConfig is a constructor of a Tracker.

func (*Tracker) GetReports added in v0.0.2

func (tr *Tracker) GetReports() ([]*Report, error)

GetReports returns the accumulated reports.

func (*Tracker) Quit

func (tr *Tracker) Quit()

Quit gracefully terminates tracker.

Jump to

Keyboard shortcuts

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