From 1c25f390c1810d53cbc6f3f8fe03419a3e628661 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Thu, 18 May 2023 14:53:28 -0400 Subject: [PATCH] Fix release build cfg issues --- src/key_value_stores/bigtable.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/key_value_stores/bigtable.rs b/src/key_value_stores/bigtable.rs index c481d15..58639a4 100644 --- a/src/key_value_stores/bigtable.rs +++ b/src/key_value_stores/bigtable.rs @@ -21,8 +21,6 @@ use metrics::{counter, describe_histogram, histogram, Unit}; use tracing::{instrument, trace}; use url::Url; -#[cfg(debug_assertions)] -use crate::memory_used::MemoryUsed; use crate::{pipeline::CONCURRENCY, Result}; use super::{KeyValueStore, KeyValueStoreNew, PipelinedGet, PipelinedSet}; @@ -216,11 +214,18 @@ impl<'store> PipelinedGet<'store> for BigTablePipelinedGet<'store> { return Err(err).context("error checking BigTable for cached values"); } }; - debug_assert!( - response.memory_used() < 1024 * 1024, - "BigTable response is using far too much memory: {} bytes", - response.memory_used() - ); + + // Check for giant cache entries. + #[cfg(debug_assertions)] + { + use crate::memory_used::MemoryUsed; + let memory_used = response.memory_used(); + debug_assert!( + memory_used < 1024 * 1024, + "BigTable response is using far too much memory: {} bytes", + memory_used + ); + } histogram!( "geocodecsv.bigtable.get_request.duration_seconds",