scraper

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0, MIT, MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTypeStd     = "std"
	LogTypeSlow    = "slow"
	LogTypeRocksDB = "rocksdb"
	LogTypeUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFileScraper

type ConfigFileScraper []string

ConfigFileScraper scraps configuration files of components

func NewConfigFileScraper

func NewConfigFileScraper(l []string) *ConfigFileScraper

NewConfigFileScraper creates a new ConfigFileScraper

func (*ConfigFileScraper) Scrap

func (s *ConfigFileScraper) Scrap(result *Sample) error

Scrap implements the Scraper interface

type FileScraper

type FileScraper struct {
	Paths []string  // paths of log files
	Start time.Time // start time
	End   time.Time // end time
}

FileScraper scraps normal files of components

func NewFileScraper

func NewFileScraper(l []string) *FileScraper

NewFlieScraper creates a new FileScraper

func (*FileScraper) Scrap

func (s *FileScraper) Scrap(result *Sample) error

Scrap implements the Scraper interface

type FileStat

type FileStat map[string]int64

FileStat is the size information of a file to scrap map: filename (full path) -> file size (bytes)

type LogScraper

type LogScraper struct {
	Paths []string        // paths of log files
	Types map[string]bool // log type
	Start time.Time       // start time
	End   time.Time       // end time
}

LogScraper scraps log files of components

func (*LogScraper) Scrap

func (s *LogScraper) Scrap(result *Sample) error

Scrap implements the Scraper interface

type Option

type Option struct {
	LogPaths          []string        // paths of log files
	LogTypes          map[string]bool // types of log need to scrap
	ConfigPaths       []string        // paths of config files
	FilePaths         []string        // paths of normal files
	PrometheusDataDir string
	Start             string // start time
	End               string // end time
}

Option is configurations of how scrapper works

type Sample

type Sample struct {
	Log    FileStat `json:"log_files,omitempty"`
	Config FileStat `json:"config_files,omitempty"`
	File   FileStat `json:"files,omitempty"`
	TSDB   FileStat `json:"prometheus_data,omitempty"`
}

Sample is the result of scrapping

type Scrapper

type Scrapper interface {
	Scrap(*Sample) error
}

Scrapper is used to scrap a kind of files

type TSDBScraper

type TSDBScraper struct {
	Paths []string  // paths of log files
	Start time.Time // start time
	End   time.Time // end time
}

TSDBScraper scraps log files of components

func (*TSDBScraper) Scrap

func (s *TSDBScraper) Scrap(result *Sample) error

Scrap implements the Scraper interface

Jump to

Keyboard shortcuts

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