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

pub struct StorageManager;
Expand description

Snapshot metrics from the underlying database.

Implementations

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.

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.

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.

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.

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

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.