pub struct StorageManager;
Expand description

Snapshot metrics from the underlying database.

Implementations§

source§

impl StorageManager

source

pub fn snapshot( &self, storage: &Database, store_name: &str, clear_store: bool ) -> Option<String>

Snapshots the given store and optionally clear it.

Arguments
  • storage - the database to read from.
  • store_name - the store to snapshot.
  • clear_store - whether to clear the data after snapshotting.
Returns

The stored data in a string encoded as JSON. If no data for the store exists, None is returned.

source

pub fn snapshot_as_json( &self, storage: &Database, store_name: &str, clear_store: bool ) -> Option<JsonValue>

Snapshots the given store and optionally clear it.

Arguments
  • storage - the database to read from.
  • store_name - the store to snapshot.
  • clear_store - whether to clear the data after snapshotting.
Returns

A JSON representation of the stored data. If no data for the store exists, None is returned.

source

pub fn snapshot_metric( &self, storage: &Database, store_name: &str, metric_id: &str, metric_lifetime: Lifetime ) -> Option<Metric>

Gets the current value of a single metric identified by name.

Arguments
  • storage - The database to get data from.
  • store_name - The store name to look into.
  • metric_id - The full metric identifier.
Returns

The decoded metric or None if no data is found.

source

pub fn snapshot_metric_for_test( &self, storage: &Database, store_name: &str, metric_id: &str, metric_lifetime: Lifetime ) -> Option<Metric>

Gets the current value of a single metric identified by name.

Use this API, rather than snapshot_metric within the testing API, so that the usage will be reported in coverage, if enabled.

Arguments
  • storage - The database to get data from.
  • store_name - The store name to look into.
  • metric_id - The full metric identifier.
Returns

The decoded metric or None if no data is found.

source

pub fn snapshot_experiments_as_json( &self, storage: &Database, store_name: &str ) -> Option<JsonValue>

Snapshots the experiments.

Arguments
  • storage - The database to get data from.
  • store_name - The store name to look into.
Returns

A JSON representation of the experiment data, in the following format:

{
 "experiment-id": {
   "branch": "branch-id",
   "extra": {
     "additional": "property",
     // ...
   }
 }
}

If no data for the store exists, None is returned.

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.