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.