Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/unify-project-…
Browse files Browse the repository at this point in the history
…states-again
  • Loading branch information
jjbayer committed Jul 23, 2024
2 parents c320ba6 + 3f03ac2 commit 5607bd3
Show file tree
Hide file tree
Showing 27 changed files with 809 additions and 945 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
**Internal**:

- Use a dedicated thread pool for CPU intensive workloads. ([#3833](https://github.com/getsentry/relay/pull/3833))
- Remove `BufferGuard` in favor of memory checks via `MemoryStat`. ([#3821](https://github.com/getsentry/relay/pull/3821))

## 24.7.0

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ anyhow = "1.0.66"
axum = "0.6.20"
axum-extra = "0.7.7"
axum-server = "0.4.7"
arc-swap = "1.7.1"
backoff = "0.4.0"
bindgen = "0.64.0"
brotli = "3.3.4"
Expand Down
14 changes: 13 additions & 1 deletion relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ pub struct Health {
pub refresh_interval_ms: u64,
/// Maximum memory watermark in bytes.
///
/// By default there is no absolute limit set and the watermark
/// By default, there is no absolute limit set and the watermark
/// is only controlled by setting [`Self::max_memory_percent`].
pub max_memory_bytes: Option<ByteSize>,
/// Maximum memory watermark as a percentage of maximum system memory.
Expand All @@ -1364,6 +1364,12 @@ pub struct Health {
///
/// Defaults to 900 milliseconds.
pub probe_timeout_ms: u64,
/// The refresh frequency of memory stats which are used to poll memory
/// usage of Relay.
///
/// The implementation of memory stats guarantees that the refresh will happen at
/// least every `x` ms since memory readings are lazy and are updated only if needed.
pub memory_stat_refresh_frequency_ms: u64,
}

impl Default for Health {
Expand All @@ -1373,6 +1379,7 @@ impl Default for Health {
max_memory_bytes: None,
max_memory_percent: 0.95,
probe_timeout_ms: 900,
memory_stat_refresh_frequency_ms: 100,
}
}
}
Expand Down Expand Up @@ -2346,6 +2353,11 @@ impl Config {
Duration::from_millis(self.values.health.probe_timeout_ms)
}

/// Refresh frequency for polling new memory stats.
pub fn memory_stat_refresh_frequency_ms(&self) -> u64 {
self.values.health.memory_stat_refresh_frequency_ms
}

/// Whether COGS measurements are enabled.
pub fn cogs_enabled(&self) -> bool {
self.values.cogs.enabled
Expand Down
Loading

0 comments on commit 5607bd3

Please sign in to comment.