scrape

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatisticSample

func StatisticSample(b []byte, contentType string, rc []*relabel.Config) (total int64, err error)

StatisticSample statistic samples from metrics raw data

Types

type JobInfo

type JobInfo struct {
	// Config is the origin scrape config in config file
	Config *config.ScrapeConfig
	// contains filtered or unexported fields
}

JobInfo contains http client for scraping target, and the origin scrape config

func (*JobInfo) Scrape

func (j *JobInfo) Scrape(url string) ([]byte, string, error)

Scrape scrape a url and return origin metrics data and contentType

type Manager

type Manager struct {
	Config *config.Config
	// contains filtered or unexported fields
}

Manager includes all cli of all jobs

func New

func New() *Manager

New create a Manager with specified cli set

func (*Manager) ApplyConfig

func (s *Manager) ApplyConfig(cfg *config.Config) error

ApplyConfig update Manager from config

func (*Manager) GetJob

func (s *Manager) GetJob(job string) *JobInfo

GetJob search job by job name, nil will be return if job not exist

Jump to

Keyboard shortcuts

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