Struct glean_core::storage::StorageManager
source · pub struct StorageManager;
Expand description
Snapshot metrics from the underlying database.
Implementations§
source§impl StorageManager
impl StorageManager
sourcepub fn snapshot(
&self,
storage: &Database,
store_name: &str,
clear_store: bool
) -> Option<String>
pub fn snapshot( &self, storage: &Database, store_name: &str, clear_store: bool ) -> Option<String>
sourcepub fn snapshot_as_json(
&self,
storage: &Database,
store_name: &str,
clear_store: bool
) -> Option<JsonValue>
pub fn snapshot_as_json( &self, storage: &Database, store_name: &str, clear_store: bool ) -> Option<JsonValue>
sourcepub fn snapshot_metric(
&self,
storage: &Database,
store_name: &str,
metric_id: &str,
metric_lifetime: Lifetime
) -> Option<Metric>
pub fn snapshot_metric( &self, storage: &Database, store_name: &str, metric_id: &str, metric_lifetime: Lifetime ) -> Option<Metric>
sourcepub fn snapshot_metric_for_test(
&self,
storage: &Database,
store_name: &str,
metric_id: &str,
metric_lifetime: Lifetime
) -> Option<Metric>
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.
sourcepub fn snapshot_experiments_as_json(
&self,
storage: &Database,
store_name: &str
) -> Option<JsonValue>
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§
impl RefUnwindSafe for StorageManager
impl Send for StorageManager
impl Sync for StorageManager
impl Unpin for StorageManager
impl UnwindSafe for StorageManager
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
Mutably borrows from an owned value. Read more
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more