pub struct BenchmarkBackend { /* private fields */ }Expand description
Public benchmark-facing backend wrapper that resolves the active metadata and object adapters without exposing the private server runtime enum.
Implementations§
Source§impl BenchmarkBackend
impl BenchmarkBackend
Sourcepub async fn isolated_local(
root: PathBuf,
public_base_url: String,
chunk_size: NonZeroUsize,
upload_max_in_flight_chunks: NonZeroUsize,
) -> Result<Self, ServerError>
pub async fn isolated_local( root: PathBuf, public_base_url: String, chunk_size: NonZeroUsize, upload_max_in_flight_chunks: NonZeroUsize, ) -> Result<Self, ServerError>
Creates an isolated local benchmark backend rooted at the supplied directory.
§Errors
Returns ServerError when local metadata or object storage cannot initialize.
Sourcepub async fn from_config(
config: &ServerConfig,
root: PathBuf,
benchmark_namespace: &str,
) -> Result<Self, ServerError>
pub async fn from_config( config: &ServerConfig, root: PathBuf, benchmark_namespace: &str, ) -> Result<Self, ServerError>
Creates a benchmark backend from the effective runtime configuration.
The benchmark namespace is appended to any configured S3 key prefix so benchmark objects cannot collide with non-benchmark data.
§Errors
Returns ServerError when the configured metadata or object adapters cannot
initialize.
Sourcepub async fn upload_file(
&self,
file_id: &str,
body: Bytes,
repository_scope: Option<&RepositoryScope>,
) -> Result<UploadFileResponse, ServerError>
pub async fn upload_file( &self, file_id: &str, body: Bytes, repository_scope: Option<&RepositoryScope>, ) -> Result<UploadFileResponse, ServerError>
Stores one logical file version.
§Errors
Returns ServerError when validation, object persistence, or metadata updates
fail.
Sourcepub async fn reconstruction(
&self,
file_id: &str,
content_hash: Option<&str>,
requested_range: Option<ByteRange>,
repository_scope: Option<&RepositoryScope>,
) -> Result<FileReconstructionResponse, ServerError>
pub async fn reconstruction( &self, file_id: &str, content_hash: Option<&str>, requested_range: Option<ByteRange>, repository_scope: Option<&RepositoryScope>, ) -> Result<FileReconstructionResponse, ServerError>
Reconstructs one logical file or range.
§Errors
Returns ServerError when the requested version is missing or any referenced
object cannot be loaded.
Sourcepub async fn download_file(
&self,
file_id: &str,
content_hash: Option<&str>,
repository_scope: Option<&RepositoryScope>,
) -> Result<Vec<u8>, ServerError>
pub async fn download_file( &self, file_id: &str, content_hash: Option<&str>, repository_scope: Option<&RepositoryScope>, ) -> Result<Vec<u8>, ServerError>
Downloads one logical file version into full bytes.
§Errors
Returns ServerError when the requested version is missing or any referenced
object cannot be loaded.
Sourcepub async fn stats(&self) -> Result<ServerStatsResponse, ServerError>
pub async fn stats(&self) -> Result<ServerStatsResponse, ServerError>
Returns storage statistics from the active backend.
§Errors
Returns ServerError when metadata or object storage cannot be traversed.
Sourcepub async fn benchmark_memory_reconstruction_cache(
&self,
file_id: &str,
content_hash: &str,
repository_scope: Option<&RepositoryScope>,
) -> Result<ReconstructionCacheBenchReport, ServerError>
pub async fn benchmark_memory_reconstruction_cache( &self, file_id: &str, content_hash: &str, repository_scope: Option<&RepositoryScope>, ) -> Result<ReconstructionCacheBenchReport, ServerError>
Measures one cold reconstruction lookup followed by one hot memory-cache hit.
§Errors
Returns ServerError when reconstruction loading or response serialization
fails.
Sourcepub const fn metadata_backend_name(&self) -> &'static str
pub const fn metadata_backend_name(&self) -> &'static str
Returns the metadata backend name used by this benchmark backend.
Sourcepub const fn object_backend_name(&self) -> &'static str
pub const fn object_backend_name(&self) -> &'static str
Returns the immutable object-storage backend name used by this benchmark backend.
Trait Implementations§
Source§impl Clone for BenchmarkBackend
impl Clone for BenchmarkBackend
Source§fn clone(&self) -> BenchmarkBackend
fn clone(&self) -> BenchmarkBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BenchmarkBackend
impl !UnwindSafe for BenchmarkBackend
impl Freeze for BenchmarkBackend
impl Send for BenchmarkBackend
impl Sync for BenchmarkBackend
impl Unpin for BenchmarkBackend
impl UnsafeUnpin for BenchmarkBackend
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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