tracker

package
v0.0.0-...-0888c38 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const KelvinSSLTargetOverride = "kelvin.%s.svc"

KelvinSSLTargetOverride the hostname used for SSL target override when sending data to Kelvin. Note: This value may differ in the future. When that happens, this should instead come from the Kelvins themselves. rather than this variable, when Kelvins send their updated state.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agents

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

Agents tracks the current state of running agent in the system. It refreshes state in the background to prevent high latencies in the critical path. The pupose of this is to simply orchestrate the agent state update, but not actually store it.

func NewAgents

func NewAgents(mdsClient metadatapb.MetadataServiceClient, signingKey string) *Agents

NewAgents creates a new agent tracker.

func NewAgentsWithInfo

func NewAgentsWithInfo(mdsClient metadatapb.MetadataServiceClient, signingKey string, agentsInfo AgentsInfo) *Agents

NewAgentsWithInfo creates an agent tracker with the AgentsInfo passed in.

func (*Agents) GetAgentInfo

func (a *Agents) GetAgentInfo() AgentsInfo

GetAgentInfo returns the current agent info.

func (*Agents) Start

func (a *Agents) Start()

Start runs the background loop of the agent tracker.

func (*Agents) Stop

func (a *Agents) Stop()

Stop stops the background loop of the agent tracker.

type AgentsInfo

type AgentsInfo interface {
	ClearPendingState()
	UpdateAgentsInfo(update *metadatapb.AgentUpdatesResponse) error
	DistributedState() distributedpb.DistributedState
}

AgentsInfo tracks information about the distributed state of the system.

func NewAgentsInfo

func NewAgentsInfo() AgentsInfo

NewAgentsInfo creates an empty agents info.

func NewTestAgentsInfo

func NewTestAgentsInfo(ds *distributedpb.DistributedState) AgentsInfo

NewTestAgentsInfo creates an agents info from a passed in distributed state.

type AgentsInfoImpl

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

AgentsInfoImpl implements AgentsInfo to track information about the distributed state of the system.

func (*AgentsInfoImpl) ClearPendingState

func (a *AgentsInfoImpl) ClearPendingState()

ClearPendingState clears the pending agents info state (the upcoming version).

func (*AgentsInfoImpl) DistributedState

func (a *AgentsInfoImpl) DistributedState() distributedpb.DistributedState

DistributedState returns the current distributed state. Returns a non-pointer because a.ds will change over time and we want the consumer of DistributedState() to have a consistent result.

func (*AgentsInfoImpl) UpdateAgentsInfo

func (a *AgentsInfoImpl) UpdateAgentsInfo(update *metadatapb.AgentUpdatesResponse) error

UpdateAgentsInfo creates a new agent info. This function must be resilient to receiving the same update twice for a given agent.

Jump to

Keyboard shortcuts

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