extractors

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartExtractor

type ChartExtractor struct {
	// ProcessName is the name of the process that the memory is referring to
	ProcessName string
	// Filename is the file to which it extracts the chart
	Filename string
	// Data is the memory usage data
	Data []ProcessStatsData
	// From is when the chart was created
	From time.Time
	// To is when the chart stopped watching for more data
	To time.Time
	// ChartsOverlap are the charts that overlap with this
	ChartsOverlap []charts.Overlaper
}

func NewChartExtractor

func NewChartExtractor(processName string, filename string, chartsOverlap []charts.Overlaper) *ChartExtractor

func (*ChartExtractor) Add

func (m *ChartExtractor) Add(data ProcessStatsData) error

func (*ChartExtractor) DivideTimeIntoParts

func (m *ChartExtractor) DivideTimeIntoParts(parts int) []string

DivideTimeIntoParts returns a string formatted time that is divided into parts

func (*ChartExtractor) Reset

func (m *ChartExtractor) Reset()

func (*ChartExtractor) StopAndExtract

func (m *ChartExtractor) StopAndExtract() error

type ChartExtractorOptions

type ChartExtractorOptions struct {
	Name         string
	Filename     string
	ChartOverlap []charts.Overlaper
}

func NewChartExtractorOptions

func NewChartExtractorOptions(processName string, filename string) ChartExtractorOptions

func (*ChartExtractorOptions) OverlapChart

func (o *ChartExtractorOptions) OverlapChart(c charts.Overlaper)

type CpuUsageData

type CpuUsageData struct {
	Percentage float32
}

type CsvMemoryUsage

type CsvMemoryUsage struct {
	Filename string
	Data     []ProcessStatsData
}

func NewCsvMemoryUsageExtractor

func NewCsvMemoryUsageExtractor(filename string) *CsvMemoryUsage

func (*CsvMemoryUsage) Add

func (c *CsvMemoryUsage) Add(data ProcessStatsData) error

func (*CsvMemoryUsage) StopAndExtract

func (c *CsvMemoryUsage) StopAndExtract() error

type CsvMemoryUsageExtractorOptions

type CsvMemoryUsageExtractorOptions struct {
	Filename string
}

func NewCsvExtractorOptions

func NewCsvExtractorOptions(filename string) CsvMemoryUsageExtractorOptions

type Extractor

type Extractor interface {
	Add(data ProcessStatsData) error
	StopAndExtract() error
}

type Extractors

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

func NewExtractors

func NewExtractors(opts ...interface{}) Extractors

func (*Extractors) Add

func (m *Extractors) Add(d ProcessStatsData) error

func (*Extractors) StopAndExtract

func (m *Extractors) StopAndExtract() error

type MemoryUsageData

type MemoryUsageData struct {
	Rss     int64
	RssSwap int64
}

type ProcessStatsData

type ProcessStatsData struct {
	MemoryUsage MemoryUsageData
	CpuUsage    CpuUsageData
	Timestamp   time.Time
}

Jump to

Keyboard shortcuts

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