[−][src]Struct glean_core::storage::StorageManager
Snapshot metrics from the underlying database.
Implementations
impl StorageManager[src]
pub fn snapshot(
&self,
storage: &Database,
store_name: &str,
clear_store: bool
) -> Option<String>[src]
&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.
pub fn snapshot_as_json(
&self,
storage: &Database,
store_name: &str,
clear_store: bool
) -> Option<JsonValue>[src]
&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.
pub fn snapshot_metric(
&self,
storage: &Database,
store_name: &str,
metric_id: &str
) -> Option<Metric>[src]
&self,
storage: &Database,
store_name: &str,
metric_id: &str
) -> Option<Metric>
Gets 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.
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]
&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
impl RefUnwindSafe for StorageManager
impl Send for StorageManager
impl Sync for StorageManager
impl Unpin for StorageManager
impl UnwindSafe for StorageManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,