open class StringsStorageEngineImplementation : GenericScalarStorageEngine<String>
(source)
StringsStorageEngineImplementation(logger: Logger = Logger("glean/StringsStorageEngine")) |
open val logger: Logger |
open lateinit var applicationContext: Context |
|
val dataStores: Array<GenericStorageMap<ScalarType>> |
|
val userLifetimeStorage: SharedPreferences |
open fun deserializeSingleMetric(value: Any?): String?
Implementor's provided function to convert deserialized 'user' lifetime data to the destination ScalarType. |
|
fun record(stores: List<String>, category: String, name: String, lifetime: Lifetime, value: String): Unit
Record a string in the desired stores. |
open fun deserializeUserLifetime(): SharedPreferences
Deserialize the metrics with a lifetime = User that are on disk. This will be called the first time a metric is used or before a snapshot is taken. |
|
fun getSnapshot(storeName: String, clearStore: Boolean): GenericDataStorage<ScalarType>?
Retrieves the recorded metric data for the provided store name. |
|
open fun getSnapshotAsJSON(storeName: String, clearStore: Boolean): Any?
Get a snapshot of the stored data as a JSON object. |
|
fun recordScalar(stores: List<String>, category: String, name: String, lifetime: Lifetime, value: ScalarType): Unit
Helper function for the derived classes. It can be used to record simple scalars to the internal storage. |
|
fun serializeSingleMetric(value: ScalarType): String?
Implementor's provided function to serialized 'user' lifetime data to String. |