Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMetrics ¶
func InitMetrics(registry *prometheus.Registry)
InitMetrics registers all metrics in this file.
Types ¶
type DummyObserver ¶
type DummyObserver struct{}
DummyObserver is an observer that does nothing
func NewDummyObserver ¶
func NewDummyObserver() *DummyObserver
NewDummyObserver creates a new DummyObserver instance
type NewObserverOpt ¶
type NewObserverOpt struct {
// contains filtered or unexported fields
}
NewObserverOpt represents available options when creating a new observer.
type NewObserverOption ¶
type NewObserverOption func(*NewObserverOpt)
NewObserverOption configures NewObserverOpt.
func WithDBConnFactory ¶
func WithDBConnFactory(factory pmysql.ConnectionFactory) NewObserverOption
WithDBConnFactory specifies factory to create db connection.
type Observer ¶
type Observer interface { // Tick is called periodically, Observer fetches performance metrics and // records them in each Tick. // Tick and Close must be concurrent safe. Tick(ctx context.Context) error Close() error }
Observer defines an interface of downstream performance observer.
func NewObserver ¶
func NewObserver( ctx context.Context, changefeedID model.ChangeFeedID, sinkURIStr string, replCfg *config.ReplicaConfig, opts ...NewObserverOption, ) (Observer, error)
NewObserver creates a new Observer
type TiDBObserver ¶
type TiDBObserver struct {
// contains filtered or unexported fields
}
TiDBObserver is a tidb performance observer. It's not thread-safe.
func NewTiDBObserver ¶
func NewTiDBObserver(db *sql.DB) *TiDBObserver
NewTiDBObserver creates a new TiDBObserver instance
Click to show internal directories.
Click to hide internal directories.