Documentation ¶
Index ¶
- type Manager
- type Replicas
- type RuntimeInfo
- type Shard
- func (s *Shard) AddReplicas(r *Replicas)
- func (s *Shard) Replicas() []*Replicas
- func (s *Shard) RuntimeInfo() (*RuntimeInfo, error)
- func (s *Shard) TargetStatus() (map[uint64]*target.ScrapeStatus, error)
- func (s *Shard) TargetsScraping() (map[uint64]bool, error)
- func (s *Shard) UpdateTarget(targets map[string][]*target.Target) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // Shards return current Shards in the cluster Shards() ([]*Shard, error) // ChangeScale create or delete Shards according to "expReplicate" ChangeScale(expReplicate int32) error }
Manager known how to create or delete Shards
type Replicas ¶
type Replicas struct { // ID is the unique ID for differentiate different replicate of shard ID string // contains filtered or unexported fields }
Replicas is a replicas of one shard all replicas of one shard scrape same targets and expected to have same load
func NewReplicas ¶
func NewReplicas(id string, url string, log logrus.FieldLogger) *Replicas
NewReplicas create a Replicas with empty scraping cache
type RuntimeInfo ¶
type RuntimeInfo struct { // HeadSeries return current head_series of prometheus HeadSeries int64 `json:"headSeries"` // IdleAt is the time this shard become idle // it is nil if this shard is not idle // TODO: user IdleAt to support shard scaling down IdleAt *time.Time `json:"idleAt,omitempty"` }
RuntimeInfo contains all running status of this shard
type Shard ¶
type Shard struct { ID string // contains filtered or unexported fields }
Shard is a shard instance contains one or more replicates it knows how to communicate with shard sidecar and manager local scraping cache
func NewGroup ¶
func NewGroup(id string, lg logrus.FieldLogger) *Shard
NewGroup return a new shard with no replicate
func (*Shard) AddReplicas ¶
AddReplicas add a Replicas to this shard
func (*Shard) RuntimeInfo ¶
func (s *Shard) RuntimeInfo() (*RuntimeInfo, error)
RuntimeInfo return the runtime status of this Shard
func (*Shard) TargetStatus ¶
func (s *Shard) TargetStatus() (map[uint64]*target.ScrapeStatus, error)
TargetStatus return the target runtime status that Shard scraping
func (*Shard) TargetsScraping ¶
TargetsScraping return the targets hash that this Shard scraping the key of the map is target hash the result is union set of all replicates
func (*Shard) UpdateTarget ¶
UpdateTarget update the scraping targets of this Shard every Replicas will compare the new targets to it's targets scraping cache and decide if communicate with sidecar or not, request will be send to sidecar only if new activeTargets not eq to the scraping