From 2f1038775b7556ab185b8b6176b2cff2ca1a8b68 Mon Sep 17 00:00:00 2001 From: luyi Date: Wed, 24 Jul 2024 15:38:25 +0200 Subject: [PATCH] RUM-5553: Create Benchmark module to collect performance metrics --- gradle/libs.versions.toml | 1 + settings.gradle.kts | 1 + tools/benchmark/.gitignore | 1 + tools/benchmark/build.gradle.kts | 55 ++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 tools/benchmark/.gitignore create mode 100644 tools/benchmark/build.gradle.kts diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0ef78853f7..67f5b541fe 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -228,6 +228,7 @@ ktorGson = { module = "io.ktor:ktor-gson", version.ref = "ktor" } # Otel jctools = { module = "org.jctools:jctools-core", version.ref = "jctools" } openTelemetryApi = { module = "io.opentelemetry:opentelemetry-api", version.ref = "openTelemetry" } +openTelemetrySdk = { module = "io.opentelemetry:opentelemetry-sdk", version.ref = "openTelemetry" } re2j = { module = "com.google.re2j:re2j", version.ref = "re2j" } [bundles] diff --git a/settings.gradle.kts b/settings.gradle.kts index 42a9284149..86d260b1ba 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -53,3 +53,4 @@ include(":tools:unit") include(":tools:noopfactory") include(":tools:javabackport") include(":tools:lint") +include(":tools:benchmark") diff --git a/tools/benchmark/.gitignore b/tools/benchmark/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/tools/benchmark/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/tools/benchmark/build.gradle.kts b/tools/benchmark/build.gradle.kts new file mode 100644 index 0000000000..7dace6d4d4 --- /dev/null +++ b/tools/benchmark/build.gradle.kts @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +import com.datadog.gradle.config.AndroidConfig +import com.datadog.gradle.config.dependencyUpdateConfig +import com.datadog.gradle.config.java17 +import com.datadog.gradle.config.junitConfig +import com.datadog.gradle.config.kotlinConfig + +plugins { + id("com.android.library") + kotlin("android") + id("com.github.ben-manes.versions") +} + +android { + defaultConfig { + compileSdk = AndroidConfig.TARGET_SDK + minSdk = AndroidConfig.MIN_SDK + } + namespace = "com.datadog.tools.benchmark" + compileOptions { + java17() + } +} + +dependencies { + + implementation(libs.kotlin) + implementation(libs.okHttp) + api(libs.openTelemetrySdk) + api(libs.openTelemetryApi) + implementation(libs.gson) + compileOnly(libs.detektApi) + testImplementation(project(":tools:unit")) { + attributes { + attribute( + com.android.build.api.attributes.ProductFlavorAttr.of("platform"), + objects.named("jvm") + ) + } + } + + testImplementation(libs.bundles.jUnit5) + testImplementation(libs.bundles.testTools) + testImplementation(libs.detektTest) + testImplementation(libs.robolectric) +} + +kotlinConfig() +junitConfig() +dependencyUpdateConfig()