From a21ceaca1da104d6903a07d29b34f9b6aa9e09a2 Mon Sep 17 00:00:00 2001 From: Stefan Kurek Date: Fri, 6 Dec 2024 12:29:40 -0500 Subject: [PATCH] MongoDB Atlas Receiver makes some minor refactor/generation tweaks --- receiver/mongodbatlasreceiver/generated_component_test.go | 4 ++-- receiver/mongodbatlasreceiver/internal/metric_conversion.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/receiver/mongodbatlasreceiver/generated_component_test.go b/receiver/mongodbatlasreceiver/generated_component_test.go index 77549ce4663e..fea6582ca05c 100644 --- a/receiver/mongodbatlasreceiver/generated_component_test.go +++ b/receiver/mongodbatlasreceiver/generated_component_test.go @@ -34,14 +34,14 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs", createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { - return factory.CreateLogs(ctx, set, cfg, consumertest.NewNop()) + return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop()) }, }, { name: "metrics", createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { - return factory.CreateMetrics(ctx, set, cfg, consumertest.NewNop()) + return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) }, }, } diff --git a/receiver/mongodbatlasreceiver/internal/metric_conversion.go b/receiver/mongodbatlasreceiver/internal/metric_conversion.go index afe80c62f323..1b5b156d1c2f 100644 --- a/receiver/mongodbatlasreceiver/internal/metric_conversion.go +++ b/receiver/mongodbatlasreceiver/internal/metric_conversion.go @@ -46,9 +46,7 @@ func calculateTotalMetrics( for _, meas := range measurements { switch meas.Name { - case "DISK_PARTITION_THROUGHPUT_READ": - fallthrough - case "DISK_PARTITION_THROUGHPUT_WRITE": + case "DISK_PARTITION_THROUGHPUT_READ", "DISK_PARTITION_THROUGHPUT_WRITE": if dptTotalMeas == nil { dptTotalMeas = cloneMeasurement(meas) dptTotalMeas.Name = "DISK_PARTITION_THROUGHPUT_TOTAL"