[][src]Struct glean_core::storage::StorageManager

pub struct StorageManager;

Snapshot metrics from the underlying database.

Methods

impl StorageManager[src]

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

Snapshot 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.

Return value

Returns the stored data in a string encoded as JSON. Returns None if no data for the store exists.

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

Snapshot 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.

Return value

Returns a JSON representation of the stored data. Returns None if no data for the store exists.

pub fn snapshot_metric(
    &self,
    storage: &Database,
    store_name: &str,
    metric_id: &str
) -> Option<Metric>
[src]

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

This look for a value in stores for all lifetimes.

Arguments:

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

Return value:

Returns the decoded metric or None if no data is found.

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

Snapshot the experiments.

Arguments:

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

Return value

Returns a JSON representation of the experiment data, in the following format:

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

Returns None if no data for experiments exists.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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