From 82ab624b36894e4989bc18aa5f1148990495b88d Mon Sep 17 00:00:00 2001 From: shikhman Date: Sat, 13 Aug 2016 13:19:31 -0700 Subject: [PATCH] Add instrumentation implementation The instrumentation implementation adds the ability to track counters for dimensional data in the codebase. Instrumentation points will be added to different parts of the codebase in upcoming CLs. The ability to export the data to Stackdriver will also be added in an upcoming CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130195199 --- java/google/registry/config/ConfigModule.java | 11 +++++++++++ java/google/registry/monitoring/whitebox/BUILD | 1 + 2 files changed, 12 insertions(+) diff --git a/java/google/registry/config/ConfigModule.java b/java/google/registry/config/ConfigModule.java index c354d11e2..b0cc8f2ee 100644 --- a/java/google/registry/config/ConfigModule.java +++ b/java/google/registry/config/ConfigModule.java @@ -480,6 +480,17 @@ public final class ConfigModule { return Duration.standardSeconds(30); } + /** + * Time interval between metric writes to Stackdriver. + * + * @see google.registry.monitoring.stackdriver.MonitoringComponent + */ + @Provides + @Config("metricWriteInterval") + public static Duration provideMetricWriteInterval() { + return Duration.standardSeconds(60); + } + /** Duration after watermark where we shouldn't deposit, because transactions might be pending. */ @Provides @Config("transactionCooldown") diff --git a/java/google/registry/monitoring/whitebox/BUILD b/java/google/registry/monitoring/whitebox/BUILD index fc9ab0c78..ad772b627 100644 --- a/java/google/registry/monitoring/whitebox/BUILD +++ b/java/google/registry/monitoring/whitebox/BUILD @@ -33,6 +33,7 @@ java_library( "//java/google/registry/mapreduce", "//java/google/registry/mapreduce/inputs", "//java/google/registry/model", + "//java/google/registry/monitoring/metrics", "//java/google/registry/request", "//java/google/registry/request:modules", "//java/google/registry/util",