Skip to content

Commit

Permalink
Fix release build cfg issues
Browse files Browse the repository at this point in the history
  • Loading branch information
emk committed May 18, 2023
1 parent f59898b commit 1c25f39
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/key_value_stores/bigtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 1c25f39

Please sign in to comment.