metricscache

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache holds the template metrics. The aggregation queries responsible for these values can take up to a minute on large deployments. Even in small deployments, aggregation queries can take a few hundred milliseconds, which would ruin page load times and database performance if in the hot path.

func New

func New(db database.Store, log slog.Logger, interval time.Duration) *Cache

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) DeploymentDAUs added in v0.15.3

func (c *Cache) DeploymentDAUs() (*codersdk.DeploymentDAUsResponse, bool)

func (*Cache) TemplateBuildTimeStats added in v0.10.0

func (c *Cache) TemplateBuildTimeStats(id uuid.UUID) codersdk.TemplateBuildTimeStats

func (*Cache) TemplateDAUs

func (c *Cache) TemplateDAUs(id uuid.UUID) (*codersdk.TemplateDAUsResponse, bool)

TemplateDAUs returns an empty response if the template doesn't have users or is loading for the first time.

func (*Cache) TemplateUniqueUsers added in v0.8.15

func (c *Cache) TemplateUniqueUsers(id uuid.UUID) (int, bool)

TemplateUniqueUsers returns the number of unique Template users from all Cache data.

Jump to

Keyboard shortcuts

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