From 6c86b32ce63f307d1a2db794942b428393b6a2d8 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 16 Oct 2024 22:24:00 +0000 Subject: [PATCH] lint fix --- .../reporting/ReportingUserSimulator.kt | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index 90612a57d9e..b060b87ee1d 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -92,12 +92,12 @@ class ReportingUserSimulator( reportsClient .withAuthenticationKey(apiAuthenticationKey) .createReport( - createReportRequest { - parent = measurementConsumerName - this.report = report - reportId = runId - } - ) + createReportRequest { + parent = measurementConsumerName + this.report = report + reportId = runId + } + ) val completedReport = pollForCompletedReport(createdReport.name) @@ -125,49 +125,50 @@ class ReportingUserSimulator( return reportingSetsClient .withAuthenticationKey(apiAuthenticationKey) .createReportingSet( - createReportingSetRequest { - parent = measurementConsumerName - reportingSet = primitiveReportingSet - } - ) + createReportingSetRequest { + parent = measurementConsumerName + reportingSet = primitiveReportingSet + } + ) } private suspend fun createMetricCalculationSpec(): MetricCalculationSpec { return metricCalculationSpecsClient .withAuthenticationKey(apiAuthenticationKey) .createMetricCalculationSpec( - createMetricCalculationSpecRequest { - parent = measurementConsumerName - metricCalculationSpec = metricCalculationSpec { - displayName = "union reach" - metricSpecs += metricSpec { - reach = - MetricSpecKt.reachParams { - singleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams {} - } - } - metricFrequencySpec = - MetricCalculationSpecKt.metricFrequencySpec { - weekly = - MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { - dayOfWeek = DayOfWeek.WEDNESDAY + createMetricCalculationSpecRequest { + parent = measurementConsumerName + metricCalculationSpec = metricCalculationSpec { + displayName = "union reach" + metricSpecs += metricSpec { + reach = + MetricSpecKt.reachParams { + singleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams {} } } - trailingWindow = - MetricCalculationSpecKt.trailingWindow { - count = 1 - increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK - } + metricFrequencySpec = + MetricCalculationSpecKt.metricFrequencySpec { + weekly = + MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { + dayOfWeek = DayOfWeek.WEDNESDAY + } + } + trailingWindow = + MetricCalculationSpecKt.trailingWindow { + count = 1 + increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK + } + } } - } - ) + ) } private suspend fun pollForCompletedReport(reportName: String): Report { while (true) { - val retrievedReport = reportsClient - .withAuthenticationKey(apiAuthenticationKey) - .getReport(getReportRequest { name = reportName }) + val retrievedReport = + reportsClient + .withAuthenticationKey(apiAuthenticationKey) + .getReport(getReportRequest { name = reportName }) @Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA") // Proto enum fields are never null. when (retrievedReport.state) {