metrics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PersonalDeletionTotalMetricName = "personal_deletion_total"
	PersonalDeletionTotalMetricHelp = "personal deletion total for repo"
)

Functions

func IsValidBranch

func IsValidBranch(s string, prefixes ...string) bool

Types

type Collector

type Collector struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(svc *models.Service) *Collector

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

func (*Collector) IterateRepos

func (c *Collector) IterateRepos(req apistructs.GittarListRepoRequest) ([]*PersonalMetric, error)

func (*Collector) RefreshPersonalContributions

func (c *Collector) RefreshPersonalContributions() error

type MetricField

type MetricField struct {
	CalculatedAt time.Time
	// Historical cumulative total
	CommitTotal     uint64
	FileChangeTotal uint64
	AdditionTotal   uint64
	DeletionTotal   uint64

	// The cumulative total within a certain duration
	DurationCommitTotal     uint64
	DurationFileChangeTotal uint64
	DurationAdditionTotal   uint64
	DurationDeletionTotal   uint64
}

type PersonalMetric

type PersonalMetric struct {
	UserName    string
	UserEmail   string
	RepoID      uint64
	Repo        string
	ProjectID   uint64
	AppID       uint64
	ProjectName string
	AppName     string
	OrgID       uint64
	OrgName     string
	Field       *MetricField
}

func NewPersonalMetric

func NewPersonalMetric(author *gitmodule.Signature, repo *models.Repo) *PersonalMetric

Jump to

Keyboard shortcuts

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