pub struct MetricsBuilder {Show 51 fields
m_id: UInt32Builder,
m_name: DictColumn,
m_description: StringBuilder,
m_unit: DictColumn,
m_kind: UInt8Builder,
m_temporality: UInt8Builder,
m_monotonic: BooleanBuilder,
m_resource_id: UInt16Builder,
m_scope_id: UInt16Builder,
metric_attrs: AttrsBuilder,
next_metric_id: u32,
num: DpHead,
num_int: Int64Builder,
num_double: Float64Builder,
hist: DpHead,
hist_stats: Stats,
hist_counts: ListBuilder<UInt64Builder>,
hist_bounds_id: UInt32Builder,
bounds_index: HashMap<Vec<u64>, u32>,
bounds_id: UInt32Builder,
bounds_values: ListBuilder<Float64Builder>,
next_bounds_id: u32,
exp: DpHead,
exp_stats: Stats,
exp_scale: Int32Builder,
exp_zero_count: UInt64Builder,
exp_zero_threshold: Float64Builder,
exp_pos_offset: Int32Builder,
exp_pos_counts: ListBuilder<UInt64Builder>,
exp_neg_offset: Int32Builder,
exp_neg_counts: ListBuilder<UInt64Builder>,
summ: DpHead,
summ_count: UInt64Builder,
summ_sum: Float64Builder,
summ_quantile: ListBuilder<Float64Builder>,
summ_value: ListBuilder<Float64Builder>,
dp_attrs: AttrsBuilder,
next_dp_id: u32,
ex_id: UInt32Builder,
ex_parent: UInt32Builder,
ex_time: TimestampNanosecondBuilder,
ex_int: Int64Builder,
ex_double: Float64Builder,
ex_trace_id: FixedSizeBinaryBuilder,
ex_span_id: FixedSizeBinaryBuilder,
exemplar_attrs: AttrsBuilder,
next_exemplar_id: u32,
rs: ResourceScope,
list_values: usize,
min_ts: i64,
max_ts: i64,
}Fields§
§m_id: UInt32Builder§m_name: DictColumn§m_description: StringBuilder§m_unit: DictColumn§m_kind: UInt8Builder§m_temporality: UInt8Builder§m_monotonic: BooleanBuilder§m_resource_id: UInt16Builder§m_scope_id: UInt16Builder§metric_attrs: AttrsBuilder§next_metric_id: u32§num: DpHead§num_int: Int64Builder§num_double: Float64Builder§hist: DpHead§hist_stats: Stats§hist_counts: ListBuilder<UInt64Builder>§hist_bounds_id: UInt32Builder§bounds_index: HashMap<Vec<u64>, u32>explicit_bounds interned by their bit patterns. f64 has no Hash and
-0.0 == 0.0 while their bits differ, so the key is the raw bits: two
bound arrays share a row only if they are byte-identical, which is the
conservative direction (a missed intern costs space, a wrong one would
mislabel every bucket).
bounds_id: UInt32Builder§bounds_values: ListBuilder<Float64Builder>§next_bounds_id: u32§exp: DpHead§exp_stats: Stats§exp_scale: Int32Builder§exp_zero_count: UInt64Builder§exp_zero_threshold: Float64Builder§exp_pos_offset: Int32Builder§exp_pos_counts: ListBuilder<UInt64Builder>§exp_neg_offset: Int32Builder§exp_neg_counts: ListBuilder<UInt64Builder>§summ: DpHead§summ_count: UInt64Builder§summ_sum: Float64Builder§summ_quantile: ListBuilder<Float64Builder>§summ_value: ListBuilder<Float64Builder>§dp_attrs: AttrsBuilder§next_dp_id: u32One counter across all four point tables — see the module header.
ex_id: UInt32Builder§ex_parent: UInt32Builder§ex_time: TimestampNanosecondBuilder§ex_int: Int64Builder§ex_double: Float64Builder§ex_trace_id: FixedSizeBinaryBuilder§ex_span_id: FixedSizeBinaryBuilder§exemplar_attrs: AttrsBuilder§next_exemplar_id: u32§rs: ResourceScope§list_values: usizeList elements written so far, for approx_bytes. Tracked rather than
measured because ListBuilder::values needs &mut self.
min_ts: i64§max_ts: i64Implementations§
Source§impl MetricsBuilder
impl MetricsBuilder
pub fn new() -> Self
Sourcepub fn num_rows(&self) -> usize
pub fn num_rows(&self) -> usize
Data points, across all four tables. This is the row count the flusher reports and the number that matters — descriptors are a rounding error.
pub fn is_empty(&self) -> bool
pub fn approx_bytes(&self) -> usize
pub fn has_headroom_for(&self, req: &ExportMetricsServiceRequest) -> bool
pub fn append_request( &mut self, req: &ExportMetricsServiceRequest, ) -> Result<usize>
fn append_metric(&mut self, m: &Metric, rid: u16, sid: u16) -> Result<usize>
Sourcefn next_point(&mut self, time: u64) -> u32
fn next_point(&mut self, time: u64) -> u32
Claim the next point id and fold its timestamp into the block’s range.
Only time_unix_nano widens the range. See crate::schema::NUMBER_DP
for why start_time_unix_nano must not.
fn append_number(&mut self, p: &NumberDataPoint, mid: u32) -> Result<()>
fn append_hist(&mut self, p: &HistogramDataPoint, mid: u32) -> Result<()>
fn append_exp_hist( &mut self, p: &ExponentialHistogramDataPoint, mid: u32, ) -> Result<()>
fn append_summary(&mut self, p: &SummaryDataPoint, mid: u32) -> Result<()>
fn append_exemplars(&mut self, dp_id: u32, exemplars: &[Exemplar]) -> Result<()>
Sourcepub fn finish(&mut self) -> Result<Sealed>
pub fn finish(&mut self) -> Result<Sealed>
Seal and reset, including on the error path — see
SignalBuilder::finish.
fn seal(&self, sidecars: Sidecars) -> Result<Sealed>
Trait Implementations§
Source§impl Default for MetricsBuilder
impl Default for MetricsBuilder
Source§impl SignalBuilder for MetricsBuilder
impl SignalBuilder for MetricsBuilder
Source§const SIGNAL: &'static str = "metrics"
const SIGNAL: &'static str = "metrics"
Source§type Request = ExportMetricsServiceRequest
type Request = ExportMetricsServiceRequest
Source§fn has_headroom_for(&self, req: &Self::Request) -> bool
fn has_headroom_for(&self, req: &Self::Request) -> bool
Source§fn append_request(&mut self, req: &Self::Request) -> Result<usize>
fn append_request(&mut self, req: &Self::Request) -> Result<usize>
Source§fn approx_bytes(&self) -> usize
fn approx_bytes(&self) -> usize
fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for MetricsBuilder
impl RefUnwindSafe for MetricsBuilder
impl Send for MetricsBuilder
impl Sync for MetricsBuilder
impl Unpin for MetricsBuilder
impl UnsafeUnpin for MetricsBuilder
impl UnwindSafe for MetricsBuilder
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].