Documentation ¶
Index ¶
- Constants
- Variables
- func AtLeastVersion(v1, v2 string) (bool, error)
- func GenericStringList(s []string) []interface{}
- func IsNetworkError(err error) bool
- func Placeholders(length int) string
- func ValidateTimeRange(beginTs, endTs string) (time.Time, time.Time, error)
- type AgentCommunicator
- type AgentFinder
Constants ¶
View Source
const (
MYSQL_DATETIME_LAYOUT = "2006-01-02 15:04:05"
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("resource not found") ErrNoMetric = errors.New("metric not found") ErrNoData = errors.New("no data in time range") ErrNoService = errors.New("service not found") ErrInvalidService = errors.New("invalid service") ErrNoInstance = errors.New("instance not found") ErrReadOnlyDb = errors.New("database is read-only") ErrDuplicateEntry = errors.New("duplicate entry") ErrGoroutineCrash = errors.New("goroutine crashed") ErrUnexpectedReturn = errors.New("unexpected return") ErrDuplicateAgent = errors.New("duplicate agent") ErrAgentNotConnected = errors.New("agent not connected") ErrLinkClosed = errors.New("link closed") ErrNotImplemented = errors.New("not implemented") ErrTimeout = errors.New("timeout") ErrAgentReplyError = errors.New("agent reply error") )
View Source
var InternalStats stats.Stats = stats.NewStats(&statsd.NoopClient{}, "", "", "", "0")
View Source
var QueryAbstracter *query.Mini
View Source
var RouteStats stats.Stats = stats.NewStats(&statsd.NoopClient{}, "", "", "", "0")
View Source
var TableParser *query.Mini
Functions ¶
func AtLeastVersion ¶
func GenericStringList ¶
func GenericStringList(s []string) []interface{}
func IsNetworkError ¶
func Placeholders ¶
Types ¶
type AgentCommunicator ¶
type AgentCommunicator interface { Start() error Stop() Done() chan bool IsAlive() bool Send(cmd *proto.Cmd) (*proto.Reply, error) }
An AgentCommunicator sends proto.Cmd to a agent, handling concurrency and hiding whether the agent is local or remote.
type AgentFinder ¶
type AgentFinder interface { Add(agentId uint, comm AgentCommunicator) error Remove(agentId uint) Get(agentId uint) AgentCommunicator Refresh(timeLimit time.Duration) }
An AgentFinder provides local clients the AgentCommunicator for an agent.
var AgentDirectory AgentFinder
Click to show internal directories.
Click to hide internal directories.