Documentation
¶
Overview ¶
Package mongodbmetrics implements metric collection for the MongoDB workload agent service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRunCommand ¶
func DefaultRunCommand(ctx context.Context, client *mongo.Client, dbName string, cmd bson.D, receiver any) (any, error)
DefaultRunCommand is the default implementation of the RunCommand function. It uses the Decode method of the SingleResult to decode the result into the receiver.
Types ¶
type MongoDBMetrics ¶
type MongoDBMetrics struct {
Config *configpb.Configuration
WLMClient workloadmanager.WLMWriter
DBcenterClient databasecenter.Client
RunCommand func(ctx context.Context, client *mongo.Client, dbName string, cmd bson.D, resultStruct any) (any, error)
// contains filtered or unexported fields
}
MongoDBMetrics contains variables and methods to collect metrics for MongoDB databases running on the current host.
func New ¶
func New(ctx context.Context, config *configpb.Configuration, wlmClient workloadmanager.WLMWriter, dbcenterClient databasecenter.Client, runCommand func(ctx context.Context, client *mongo.Client, dbName string, cmd bson.D, resultStruct any) (any, error)) *MongoDBMetrics
New creates a new MongoDBMetrics object initialized with default values.
func (*MongoDBMetrics) CollectMetricsOnce ¶
func (m *MongoDBMetrics) CollectMetricsOnce(ctx context.Context, dwActivated bool) (*workloadmanager.WorkloadMetrics, error)
CollectMetricsOnce collects metrics for MongoDB databases running on the host.
Click to show internal directories.
Click to hide internal directories.