Struct mz_persist_client::usage::StorageUsageClient
source · pub struct StorageUsageClient {
cfg: PersistConfig,
blob: Arc<dyn Blob>,
metrics: Arc<Metrics>,
state_versions: Arc<StateVersions>,
}
Expand description
Provides access to storage usage metrics for a specific Blob
Fields§
§cfg: PersistConfig
§blob: Arc<dyn Blob>
§metrics: Arc<Metrics>
§state_versions: Arc<StateVersions>
Implementations§
source§impl StorageUsageClient
impl StorageUsageClient
sourcepub fn open(client: PersistClient) -> Self
pub fn open(client: PersistClient) -> Self
Creates a new StorageUsageClient.
sourcepub async fn shard_usage_referenced(
&self,
shard_id: ShardId,
) -> ShardUsageReferenced
pub async fn shard_usage_referenced( &self, shard_id: ShardId, ) -> ShardUsageReferenced
Computes ShardUsageReferenced for a single shard. Suitable for customer billing.
sourcepub async fn shards_usage_referenced<I>(
&self,
shard_ids: I,
) -> ShardsUsageReferencedwhere
I: IntoIterator<Item = ShardId>,
pub async fn shards_usage_referenced<I>(
&self,
shard_ids: I,
) -> ShardsUsageReferencedwhere
I: IntoIterator<Item = ShardId>,
Computes ShardUsageReferenced for a given set of shards. Suitable for customer billing.
sourcepub async fn shard_usage_audit(&self, shard_id: ShardId) -> ShardUsageAudit
pub async fn shard_usage_audit(&self, shard_id: ShardId) -> ShardUsageAudit
Computes ShardUsageAudit for a single shard.
Performs a full scan of Blob and mz_persist::location::Consensus to compute a full audit of blob usage, categorizing both referenced and unreferenced blobs (see ShardUsageAudit for full details). While ShardUsageAudit::referenced_bytes is suitable for billing, prefer Self::shard_usage_referenced to avoid the (costly!) scan of Blob if the additional categorizations are not needed.
sourcepub async fn shards_usage_audit(&self) -> ShardsUsageAudit
pub async fn shards_usage_audit(&self) -> ShardsUsageAudit
Computes ShardUsageAudit for every shard in an env.
See Self::shard_usage_audit for more details on when to use a full audit.
async fn blob_raw_usage(&self, prefix: BlobKeyPrefix<'_>) -> BlobUsage
async fn shard_usage_given_blob_usage( &self, shard_id: ShardId, blob_usage: &ShardBlobUsage, ) -> ShardUsageAudit
Trait Implementations§
source§impl Clone for StorageUsageClient
impl Clone for StorageUsageClient
source§fn clone(&self) -> StorageUsageClient
fn clone(&self) -> StorageUsageClient
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for StorageUsageClient
impl !RefUnwindSafe for StorageUsageClient
impl Send for StorageUsageClient
impl Sync for StorageUsageClient
impl Unpin for StorageUsageClient
impl !UnwindSafe for StorageUsageClient
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.