Versions in this module Expand all Collapse all v1 v1.0.10 Jan 17, 2023 v1.0.1 Jan 19, 2023 v1.0.0 Jan 19, 2023 Changes in this version + const DefaultHealthCheckRetryDelay + const DefaultHealthCheckTimeout + const DefaultTopoReadConcurrency + const DefaultTopologyWatcherRefreshInterval + const HealthCheckTemplate + func IsReplicationLagHigh(tabletStats *TabletStats) bool + func IsReplicationLagVeryHigh(tabletStats *TabletStats) bool + func MakeAggregateMap(stats []*TabletStats) map[string]*querypb.AggregateStats + func MakeAggregateMapDiff(keyspace, shard string, tabletType topodatapb.TabletType, ter int64, ...) []*srvtopo.TargetStatsEntry + func ParseTabletURLTemplateFromFlag() + func TabletToMapKey(tablet *topodatapb.Tablet) string + func TrivialStatsUpdate(o, n *TabletStats) bool + type FakeHealthCheck struct + func NewFakeHealthCheck() *FakeHealthCheck + func (fhc *FakeHealthCheck) AddFakeTablet(cell, host string, port int32, keyspace, shard string, ...) queryservice.QueryService + func (fhc *FakeHealthCheck) AddTablet(tablet *topodatapb.Tablet, name string) + func (fhc *FakeHealthCheck) AddTestTablet(cell, host string, port int32, keyspace, shard string, ...) *sandboxconn.SandboxConn + func (fhc *FakeHealthCheck) CacheStatus() TabletsCacheStatusList + func (fhc *FakeHealthCheck) Close() error + func (fhc *FakeHealthCheck) GetAllTablets() map[string]*topodatapb.Tablet + func (fhc *FakeHealthCheck) GetConnection(key string) queryservice.QueryService + func (fhc *FakeHealthCheck) RegisterStats() + func (fhc *FakeHealthCheck) RemoveTablet(tablet *topodatapb.Tablet) + func (fhc *FakeHealthCheck) ReplaceTablet(old, new *topodatapb.Tablet, name string) + func (fhc *FakeHealthCheck) Reset() + func (fhc *FakeHealthCheck) SetListener(listener HealthCheckStatsListener, sendDownEvents bool) + func (fhc *FakeHealthCheck) WaitForInitialStatsUpdates() + type FilterByShard struct + func NewFilterByShard(tr TabletRecorder, filters []string) (*FilterByShard, error) + func (fbs *FilterByShard) AddTablet(tablet *topodatapb.Tablet, name string) + func (fbs *FilterByShard) RemoveTablet(tablet *topodatapb.Tablet) + func (fbs *FilterByShard) ReplaceTablet(old, new *topodatapb.Tablet, name string) + type HealthCheck interface + CacheStatus func() TabletsCacheStatusList + Close func() error + GetConnection func(key string) queryservice.QueryService + RegisterStats func() + SetListener func(listener HealthCheckStatsListener, sendDownEvents bool) + WaitForInitialStatsUpdates func() + func NewDefaultHealthCheck() HealthCheck + func NewHealthCheck(retryDelay, healthCheckTimeout time.Duration) HealthCheck + type HealthCheckImpl struct + func (hc *HealthCheckImpl) AddTablet(tablet *topodatapb.Tablet, name string) + func (hc *HealthCheckImpl) CacheStatus() TabletsCacheStatusList + func (hc *HealthCheckImpl) Close() error + func (hc *HealthCheckImpl) GetConnection(key string) queryservice.QueryService + func (hc *HealthCheckImpl) RegisterStats() + func (hc *HealthCheckImpl) RemoveTablet(tablet *topodatapb.Tablet) + func (hc *HealthCheckImpl) ReplaceTablet(old, new *topodatapb.Tablet, name string) + func (hc *HealthCheckImpl) ServeHTTP(w http.ResponseWriter, _ *http.Request) + func (hc *HealthCheckImpl) SetListener(listener HealthCheckStatsListener, sendDownEvents bool) + func (hc *HealthCheckImpl) WaitForInitialStatsUpdates() + type HealthCheckStatsListener interface + StatsUpdate func(*TabletStats) + type TabletRecorder interface + AddTablet func(tablet *topodatapb.Tablet, name string) + RemoveTablet func(tablet *topodatapb.Tablet) + ReplaceTablet func(old, new *topodatapb.Tablet, name string) + type TabletStats struct + Key string + LastError error + Name string + Serving bool + Stats *querypb.RealtimeStats + Tablet *topodatapb.Tablet + TabletExternallyReparentedTimestamp int64 + Target *querypb.Target + Up bool + func FilterByReplicationLag(tabletStatsList []*TabletStats) []*TabletStats + func RemoveUnhealthyTablets(tabletStatsList []TabletStats) []TabletStats + func (e *TabletStats) Copy() *TabletStats + func (e *TabletStats) DeepEqual(f *TabletStats) bool + func (e *TabletStats) String() string + func (e TabletStats) GetHostNameLevel(level int) string + func (e TabletStats) GetTabletHostPort() string + type TabletStatsCache struct + func NewTabletStatsCache(hc HealthCheck, ts *topo.Server, cell string) *TabletStatsCache + func NewTabletStatsCacheDoNotSetListener(ts *topo.Server, cell string) *TabletStatsCache + func (tc *TabletStatsCache) GetAggregateStats(target *querypb.Target) (*querypb.AggregateStats, error) + func (tc *TabletStatsCache) GetHealthyTabletStats(keyspace, shard string, tabletType topodatapb.TabletType) []TabletStats + func (tc *TabletStatsCache) GetMasterCell(keyspace, shard string) (cell string, err error) + func (tc *TabletStatsCache) GetTabletStats(keyspace, shard string, tabletType topodatapb.TabletType) []TabletStats + func (tc *TabletStatsCache) ResetForTesting() + func (tc *TabletStatsCache) StatsUpdate(ts *TabletStats) + func (tc *TabletStatsCache) Subscribe() (int, []srvtopo.TargetStatsEntry, <-chan (*srvtopo.TargetStatsEntry), error) + func (tc *TabletStatsCache) Unsubscribe(i int) error + func (tc *TabletStatsCache) WaitForAllServingTablets(ctx context.Context, targets []*querypb.Target) error + func (tc *TabletStatsCache) WaitForAnyTablet(ctx context.Context, cell, keyspace, shard string, ...) error + func (tc *TabletStatsCache) WaitForTablets(ctx context.Context, cell, keyspace, shard string, ...) error + type TabletStatsList []*TabletStats + func (tsl TabletStatsList) Len() int + func (tsl TabletStatsList) Less(i, j int) bool + func (tsl TabletStatsList) Swap(i, j int) + type TabletsCacheStatus struct + Cell string + TabletsStats TabletStatsList + Target *querypb.Target + func (tcs *TabletsCacheStatus) StatusAsHTML() template.HTML + type TabletsCacheStatusList []*TabletsCacheStatus + func (tcsl TabletsCacheStatusList) Len() int + func (tcsl TabletsCacheStatusList) Less(i, j int) bool + func (tcsl TabletsCacheStatusList) Swap(i, j int) + type TopologyWatcher struct + func NewCellTabletsWatcher(topoServer *topo.Server, tr TabletRecorder, cell string, ...) *TopologyWatcher + func NewShardReplicationWatcher(topoServer *topo.Server, tr TabletRecorder, cell, keyspace, shard string, ...) *TopologyWatcher + func NewTopologyWatcher(topoServer *topo.Server, tr TabletRecorder, cell string, ...) *TopologyWatcher + func (tw *TopologyWatcher) RefreshLag() time.Duration + func (tw *TopologyWatcher) Stop() + func (tw *TopologyWatcher) TopoChecksum() uint32 + func (tw *TopologyWatcher) WaitForInitialTopology() error