fleet/server/fleet/statistics.go
Tomas Touceda ece05eeaed
Issue 1321 usage statistics (#1415)
* WIP

* Send usage analytics

* Improve loggin of cron tasks and fix test

* Implement appconfig method now that we are checking that as well

* Address review comments
2021-07-20 18:39:50 -03:00

18 lines
424 B
Go

package fleet
import "time"
type StatisticsPayload struct {
AnonymousIdentifier string `json:"anonymousIdentifier"`
FleetVersion string `json:"fleetVersion"`
NumHostsEnrolled int `json:"numHostsEnrolled"`
}
type StatisticsStore interface {
ShouldSendStatistics(frequency time.Duration) (StatisticsPayload, bool, error)
RecordStatisticsSent() error
}
const (
StatisticsFrequency = time.Hour * 24 * 7
)