Skip to content

Commit

Permalink
refactoring spendreporting for WOR-430 (#2027)
Browse files Browse the repository at this point in the history
* simplified unit tests to require less mocking

* made spend report aggregation static and remove slickDatasource from some tests

makes it obvious that the aggregation doesn't use any class resources, and shaves multiple seconds off unit tests

* finished removing usages of TestDriverComponent

Tests for spend reports are now completely mocked, with no external db calls

* add metrics to spend reporting service

* moved query specific logic to query building function

* move query setup to a separate function

* add convenience methods to create rawls exceptions

avoids the intermediary step of having to explicitly create the error report
  • Loading branch information
blakery authored Sep 12, 2022
1 parent 2c67cd6 commit f27dfca
Show file tree
Hide file tree
Showing 6 changed files with 741 additions and 876 deletions.
3 changes: 2 additions & 1 deletion core/src/main/scala/org/broadinstitute/dsde/rawls/Boot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ object Boot extends IOApp with LazyLogging {
val spendReportingServiceConfig = SpendReportingServiceConfig(
gcsConfig.getString("billingExportTableName"),
gcsConfig.getString("billingExportTimePartitionColumn"),
gcsConfig.getConfig("spendReporting").getInt("maxDateRange")
gcsConfig.getConfig("spendReporting").getInt("maxDateRange"),
metricsPrefix,
)

val spendReportingServiceConstructor: RawlsRequestContext => SpendReportingService =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.broadinstitute.dsde.rawls.config

final case class SpendReportingServiceConfig(defaultTableName: String,
defaultTimePartitionColumn: String,
maxDateRange: Int
final case class SpendReportingServiceConfig(
defaultTableName: String,
defaultTimePartitionColumn: String,
maxDateRange: Int,
workbenchMetricBaseName: String
)
Loading

0 comments on commit f27dfca

Please sign in to comment.