Documentation
¶
Overview ¶
Package badgerdb implements the storageclient interface with BadgerDB
Index ¶
- type AdditionalOptions
- type Client
- func (cl Client) GetExperimentResult(namespace, experiment string) (*base.ExperimentResult, error)
- func (cl Client) GetMetrics(applicationName string, version int, signature string) (*storage.VersionMetrics, error)
- func (cl Client) SetExperimentResult(namespace, experiment string, data *base.ExperimentResult) error
- func (cl Client) SetMetric(applicationName string, version int, ...) error
- func (cl Client) SetUser(applicationName string, version int, signature, user string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalOptions ¶
AdditionalOptions are additional options for setting up BadgerDB
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the BadgerDB
func GetClient ¶
func GetClient(opts badger.Options, additionalOptions AdditionalOptions) (*Client, error)
GetClient gets a client for the BadgerDB
func (Client) GetExperimentResult ¶ added in v0.16.0
func (cl Client) GetExperimentResult(namespace, experiment string) (*base.ExperimentResult, error)
GetExperimentResult sets the experiment result for a particular namespace and experiment name the data is []byte in order to make this function reusable for different tasks
func (Client) GetMetrics ¶
func (cl Client) GetMetrics(applicationName string, version int, signature string) (*storage.VersionMetrics, error)
GetMetrics returns a nested map of the metrics data for a particular application, version, and signature Example:
{ "my-metric": { "MetricsOverTransactions": [1, 1, 3, 4, 5] "MetricsOverUsers": [2, 7, 5] } }
NOTE: for users that have not produced any metrics (for example, via lookup()), GetMetrics() will add 0s for the extra users in metricsOverUsers
Example, given 5 total users:
{ "my-metric": { "MetricsOverTransactions": [1, 1, 3, 4, 5] "MetricsOverUsers": [2, 7, 5, 0, 0] } }
func (Client) SetExperimentResult ¶ added in v0.16.0
func (cl Client) SetExperimentResult(namespace, experiment string, data *base.ExperimentResult) error
SetExperimentResult sets the experiment result for a particular namespace and experiment name the data is []byte in order to make this function reusable for different tasks
func (Client) SetMetric ¶
func (cl Client) SetMetric(applicationName string, version int, signature, metric, user, transaction string, metricValue float64) error
SetMetric sets a metric based on the app name, version, signature, metric type, user name, transaction ID, and metric value with BadgerDB Example key: kt-metric::my-app::0::my-signature::my-metric::my-user::my-transaction-id -> my-metric-value