mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
rename ScrapeManager struct to Manager to remove stutter
This commit is contained in:
parent
b75428ec19
commit
6ce84dbcb1
|
@ -31,10 +31,10 @@ type Appendable interface {
|
|||
Appender() (storage.Appender, error)
|
||||
}
|
||||
|
||||
// NewManager is the ScrapeManager constructor
|
||||
func NewManager(logger log.Logger, app Appendable) *ScrapeManager {
|
||||
// NewManager is the Manager constructor
|
||||
func NewManager(logger log.Logger, app Appendable) *Manager {
|
||||
|
||||
return &ScrapeManager{
|
||||
return &Manager{
|
||||
append: app,
|
||||
logger: logger,
|
||||
scrapeConfigs: make(map[string]*config.ScrapeConfig),
|
||||
|
@ -43,9 +43,9 @@ func NewManager(logger log.Logger, app Appendable) *ScrapeManager {
|
|||
}
|
||||
}
|
||||
|
||||
// ScrapeManager maintains a set of scrape pools and manages start/stop cycles
|
||||
// Manager maintains a set of scrape pools and manages start/stop cycles
|
||||
// when receiving new target groups form the discovery manager.
|
||||
type ScrapeManager struct {
|
||||
type Manager struct {
|
||||
logger log.Logger
|
||||
append Appendable
|
||||
scrapeConfigs map[string]*config.ScrapeConfig
|
||||
|
@ -55,7 +55,7 @@ type ScrapeManager struct {
|
|||
}
|
||||
|
||||
// Run starts background processing to handle target updates and reload the scraping loops.
|
||||
func (m *ScrapeManager) Run(tsets <-chan map[string][]*targetgroup.Group) error {
|
||||
func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) error {
|
||||
for {
|
||||
select {
|
||||
case ts := <-tsets:
|
||||
|
@ -67,7 +67,7 @@ func (m *ScrapeManager) Run(tsets <-chan map[string][]*targetgroup.Group) error
|
|||
}
|
||||
|
||||
// Stop cancels all running scrape pools and blocks until all have exited.
|
||||
func (m *ScrapeManager) Stop() {
|
||||
func (m *Manager) Stop() {
|
||||
for _, sp := range m.scrapePools {
|
||||
sp.stop()
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ func (m *ScrapeManager) Stop() {
|
|||
}
|
||||
|
||||
// ApplyConfig resets the manager's target providers and job configurations as defined by the new cfg.
|
||||
func (m *ScrapeManager) ApplyConfig(cfg *config.Config) error {
|
||||
func (m *Manager) ApplyConfig(cfg *config.Config) error {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
c := make(map[string]*config.ScrapeConfig)
|
||||
|
@ -98,7 +98,7 @@ func (m *ScrapeManager) ApplyConfig(cfg *config.Config) error {
|
|||
}
|
||||
|
||||
// TargetMap returns map of active and dropped targets and their corresponding scrape config job name.
|
||||
func (m *ScrapeManager) TargetMap() map[string][]*Target {
|
||||
func (m *Manager) TargetMap() map[string][]*Target {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
|
||||
|
@ -116,7 +116,7 @@ func (m *ScrapeManager) TargetMap() map[string][]*Target {
|
|||
}
|
||||
|
||||
// Targets returns the targets currently being scraped.
|
||||
func (m *ScrapeManager) Targets() []*Target {
|
||||
func (m *Manager) Targets() []*Target {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
|
||||
|
@ -132,7 +132,7 @@ func (m *ScrapeManager) Targets() []*Target {
|
|||
return targets
|
||||
}
|
||||
|
||||
func (m *ScrapeManager) reload(t map[string][]*targetgroup.Group) {
|
||||
func (m *Manager) reload(t map[string][]*targetgroup.Group) {
|
||||
for tsetName, tgroup := range t {
|
||||
scrapeConfig, ok := m.scrapeConfigs[tsetName]
|
||||
if !ok {
|
||||
|
|
|
@ -71,7 +71,7 @@ var localhostRepresentations = []string{"127.0.0.1", "localhost"}
|
|||
type Handler struct {
|
||||
logger log.Logger
|
||||
|
||||
scrapeManager *scrape.ScrapeManager
|
||||
scrapeManager *scrape.Manager
|
||||
ruleManager *rules.Manager
|
||||
queryEngine *promql.Engine
|
||||
context context.Context
|
||||
|
@ -125,7 +125,7 @@ type Options struct {
|
|||
TSDB func() *tsdb.DB
|
||||
Storage storage.Storage
|
||||
QueryEngine *promql.Engine
|
||||
ScrapeManager *scrape.ScrapeManager
|
||||
ScrapeManager *scrape.Manager
|
||||
RuleManager *rules.Manager
|
||||
Notifier *notifier.Manager
|
||||
Version *PrometheusVersion
|
||||
|
|
Loading…
Reference in a new issue