Documentation ¶
Overview ¶
Package metrics collects string constants used to report anonymous usage metrics.
Index ¶
Constants ¶
const ( // Setup is used to group metrics related to bridge setup e.g. first start, new user. Setup = Category("setup") // FirstStart signifies that the bridge has been started for the first time on a user's // machine (or at least, no config directory was found). FirstStart = Action("first_start") // NewUser signifies a new user account has been added to the bridge. NewUser = Action("new_user") )
Metrics related to bridge/account setup.
const ( // Heartbeat is used to group heartbeat metrics e.g. the daily alive signal. Heartbeat = Category("heartbeat") // Daily is a daily signal that indicates continued bridge usage. Daily = Action("daily") )
Metrics related to heartbeats of various kinds.
const ( // Import is used to group import metrics. Import = Category("import") // Export is used to group export metrics. Export = Category("export") // TransferLoad signifies that the transfer load source. // It can be IMAP or local files for import, or PM for export. // With this will be reported also label with number of source mailboxes. TransferLoad = Action("load") // TransferStart signifies started transfer. TransferStart = Action("start") // TransferComplete signifies completed transfer without crash. TransferComplete = Action("complete") // TransferCancel signifies cancelled transfer by an user. TransferCancel = Action("cancel") // TransferFail signifies stopped transfer because of an fatal error. TransferFail = Action("fail") )
Metrics related to import-export (transfer) process.
const NoLabel = Label("")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric represents a single metric that can be reported and contains the necessary fields of category, action and label that the /metrics endpoint expects.
func New ¶
New returns a metric struct with the given category, action and label. Maybe in future we could perform checks here that the correct category is given for each action. That's why the Metric fields are not exported; we don't want users creating broken metrics (though for now they still can do that).