usagestats

package
v0.0.0-...-8eaa7ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricFunc

type MetricFunc func() (interface{}, error)

type UsageReport

type UsageReport struct {
	Version         string                 `json:"version"`
	Metrics         map[string]interface{} `json:"metrics"`
	Os              string                 `json:"os"`
	Arch            string                 `json:"arch"`
	Edition         string                 `json:"edition"`
	HasValidLicense bool                   `json:"hasValidLicense"`
	Packaging       string                 `json:"packaging"`
}

type UsageStats

type UsageStats interface {
	GetUsageReport(ctx context.Context) (UsageReport, error)

	RegisterMetric(name string, fn MetricFunc)
}

type UsageStatsService

type UsageStatsService struct {
	Cfg                *setting.Cfg               `inject:""`
	Bus                bus.Bus                    `inject:""`
	SQLStore           *sqlstore.SQLStore         `inject:""`
	AlertingUsageStats alerting.UsageStatsQuerier `inject:""`
	License            models.Licensing           `inject:""`
	// contains filtered or unexported fields
}

func (*UsageStatsService) GetConcurrentUsersStats

func (uss *UsageStatsService) GetConcurrentUsersStats(ctx context.Context) (*concurrentUsersStats, error)

func (*UsageStatsService) GetUsageReport

func (uss *UsageStatsService) GetUsageReport(ctx context.Context) (UsageReport, error)

func (*UsageStatsService) Init

func (uss *UsageStatsService) Init() error

func (*UsageStatsService) RegisterMetric

func (uss *UsageStatsService) RegisterMetric(name string, fn MetricFunc)

func (*UsageStatsService) Run

func (uss *UsageStatsService) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL