relay_metrics::aggregator

Struct AggregatorConfig

source
pub struct AggregatorConfig {
    pub bucket_interval: u32,
    pub aggregator_size: u32,
    pub initial_delay: u32,
    pub max_secs_in_past: u64,
    pub max_secs_in_future: u64,
    pub max_project_key_bucket_bytes: Option<u64>,
    pub max_total_bucket_bytes: Option<u64>,
    pub flush_partitions: Option<u32>,
    pub flush_batching: FlushBatching,
}
Expand description

Parameters used by the crate::aggregator::Aggregator.

Fields§

§bucket_interval: u32

Determines the wall clock time interval for buckets in seconds.

Defaults to 10 seconds. Every metric is sorted into a bucket of this size based on its timestamp. This defines the minimum granularity with which metrics can be queried later.

§aggregator_size: u32

The aggregator size.

This determines how many individual bucket intervals, are stored in the aggregator. Increasing this number will add additional delay for backdated and future buckets.

Defaults to: 1.

§initial_delay: u32

The initial delay in seconds to wait before flushing a bucket.

Defaults to 30 seconds. Before sending an aggregated bucket, this is the time Relay waits for buckets that are being reported in real time.

§max_secs_in_past: u64

The age in seconds of the oldest allowed bucket timestamp.

Defaults to 5 days.

§max_secs_in_future: u64

The time in seconds that a timestamp may be in the future.

Defaults to 1 minute.

§max_project_key_bucket_bytes: Option<u64>

Maximum amount of bytes used for metrics aggregation per project key.

Similar measuring technique to Self::max_total_bucket_bytes, but instead of a global/process-wide limit, it is enforced per project key.

Defaults to None, i.e. no limit.

§max_total_bucket_bytes: Option<u64>

Maximum amount of bytes used for metrics aggregation.

When aggregating metrics, Relay keeps track of how many bytes a metric takes in memory. This is only an approximation and does not take into account things such as pre-allocation in hashmaps.

Defaults to None, i.e. no limit.

§flush_partitions: Option<u32>

The number of logical partitions that can receive flushed buckets.

§flush_batching: FlushBatching

The batching mode for the flushing of the aggregator.

Batching is applied via shifts to the flushing time that is determined when the first bucket is inserted. Thanks to the shifts, Relay is able to prevent flushing all buckets from a bucket interval at the same time.

For example, the aggregator can choose to shift by the same value all buckets within a given partition, effectively allowing all the elements of that partition to be flushed together.

Trait Implementations§

source§

impl Clone for AggregatorConfig

source§

fn clone(&self) -> AggregatorConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AggregatorConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AggregatorConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AggregatorConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for AggregatorConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T