abstract class GenericScalarStorageEngine<ScalarType> : StorageEngine
(source)
A base class for 'scalar' like metrics. This allows sharing the common store managing and lifetime behaviours.
GenericScalarStorageEngine()
A base class for 'scalar' like metrics. This allows sharing the common store managing and lifetime behaviours. |
open lateinit var applicationContext: Context |
|
val dataStores: Array<GenericStorageMap<ScalarType>> |
|
abstract val logger: Logger |
|
val userLifetimeStorage: SharedPreferences |
abstract fun deserializeSingleMetric(value: Any?): ScalarType?
Implementor's provided function to convert deserialized 'user' lifetime data to the destination ScalarType. |
|
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(metricData: CommonMetricData, 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. |
open class StringsStorageEngineImplementation : GenericScalarStorageEngine<String> |
|
open class UuidsStorageEngineImplementation : GenericScalarStorageEngine<UUID> |