Documentation ¶
Index ¶
Constants ¶
const ( // ReplicationLag should be the key for any reporters // reporting MySQL repliaction lag. ReplicationLag = "replication_lag" // ReplicationLagHigh should be the value for any reporters // indicating that the replication lag is too high. ReplicationLagHigh = "high" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator aggregates the results of many Reporters.
func (*Aggregator) HTMLName ¶
func (ag *Aggregator) HTMLName() template.HTML
HTMLName returns an aggregate name for all the reporters
func (*Aggregator) Register ¶
func (ag *Aggregator) Register(name string, rep Reporter)
Register registers rep with ag. Only keys specified in keys will be aggregated from this particular Reporter.
func (*Aggregator) Run ¶
func (ag *Aggregator) Run(typ topo.TabletType) (map[string]string, error)
Run runs aggregates health statuses from all the reporters. If any errors occur during the reporting, they will be logged, but only the first error will be returned. It may return an empty map if no health condition is detected. Note it will not return nil, but an empty map.
type FunctionReporter ¶
type FunctionReporter func(typ topo.TabletType) (map[string]string, error)
FunctionReporter is a function that may act as a Reporter.
func (FunctionReporter) HTMLName ¶
func (fc FunctionReporter) HTMLName() template.HTML
HTMLName implements Reporter.HTMLName
func (FunctionReporter) Report ¶
func (fc FunctionReporter) Report(typ topo.TabletType) (status map[string]string, err error)
Report implements Reporter.Report
type Reporter ¶
type Reporter interface { // Report returns a map of health states for the tablet // assuming that its tablet type is typ. If Report returns an // error it implies that the tablet is in a bad shape and not // able to handle queries. Report(typ topo.TabletType) (status map[string]string, err error) // HTMLName returns a displayable name for the module. // Can be used to be displayed in the status page. HTMLName() template.HTML }
Reporter reports the health status of a tablet.