schemas

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMergeRequestIIDFromRefName added in v0.5.0

func GetMergeRequestIIDFromRefName(refName string) (string, error)

GetMergeRequestIIDFromRefName parse a refName to extract a merge request IID

func GetRefRegexp added in v0.5.0

func GetRefRegexp(ppr config.ProjectPullRefs, rk RefKind) (re *regexp.Regexp, err error)

GetRefRegexp returns the expected regexp given a ProjectPullRefs config and a RefKind

Types

type Deployment

type Deployment struct {
	JobID           int
	RefKind         RefKind
	RefName         string
	Username        string
	Timestamp       float64
	DurationSeconds float64
	CommitShortID   string
	Status          string
}

Deployment ..

type Environment

type Environment struct {
	ProjectName      string
	ID               int
	Name             string
	ExternalURL      string
	Available        bool
	LatestDeployment Deployment

	OutputSparseStatusMetrics bool
}

Environment ..

func (Environment) DefaultLabelsValues

func (e Environment) DefaultLabelsValues() map[string]string

DefaultLabelsValues ..

func (Environment) InformationLabelsValues

func (e Environment) InformationLabelsValues() (v map[string]string)

InformationLabelsValues ..

func (Environment) Key

func (e Environment) Key() EnvironmentKey

Key ..

type EnvironmentKey

type EnvironmentKey string

EnvironmentKey ..

type Environments

type Environments map[EnvironmentKey]Environment

Environments allows us to keep track of all the Environment objects we have discovered

func (Environments) Count

func (envs Environments) Count() int

Count returns the amount of environments in the map

type Job

type Job struct {
	ID                    int
	Name                  string
	Stage                 string
	Timestamp             float64
	DurationSeconds       float64
	QueuedDurationSeconds float64
	Status                string
	ArtifactSize          float64
	Runner                Runner
}

Job ..

func NewJob

func NewJob(gj goGitlab.Job) Job

NewJob ..

type Jobs

type Jobs map[string]Job

Jobs ..

type Metric

type Metric struct {
	Kind   MetricKind
	Labels prometheus.Labels
	Value  float64
}

Metric ..

func (Metric) Key

func (m Metric) Key() MetricKey

Key ..

type MetricKey

type MetricKey string

MetricKey ..

type MetricKind

type MetricKind int32

MetricKind ..

const (
	// MetricKindCoverage refers to the coerage of a job/pipeline
	MetricKindCoverage MetricKind = iota

	// MetricKindDurationSeconds ..
	MetricKindDurationSeconds

	// MetricKindEnvironmentBehindCommitsCount ..
	MetricKindEnvironmentBehindCommitsCount

	// MetricKindEnvironmentBehindDurationSeconds ..
	MetricKindEnvironmentBehindDurationSeconds

	// MetricKindEnvironmentDeploymentCount ..
	MetricKindEnvironmentDeploymentCount

	// MetricKindEnvironmentDeploymentDurationSeconds ..
	MetricKindEnvironmentDeploymentDurationSeconds

	// MetricKindEnvironmentDeploymentJobID ..
	MetricKindEnvironmentDeploymentJobID

	// MetricKindEnvironmentDeploymentStatus ..
	MetricKindEnvironmentDeploymentStatus

	// MetricKindEnvironmentDeploymentTimestamp ..
	MetricKindEnvironmentDeploymentTimestamp

	// MetricKindEnvironmentInformation ..
	MetricKindEnvironmentInformation

	// MetricKindID ..
	MetricKindID

	// MetricKindJobArtifactSizeBytes ..
	MetricKindJobArtifactSizeBytes

	// MetricKindJobDurationSeconds ..
	MetricKindJobDurationSeconds

	// MetricKindJobID ..
	MetricKindJobID

	// MetricKindJobQueuedDurationSeconds ..
	MetricKindJobQueuedDurationSeconds

	// MetricKindJobRunCount ..
	MetricKindJobRunCount

	// MetricKindJobStatus ..
	MetricKindJobStatus

	// MetricKindJobTimestamp ..
	MetricKindJobTimestamp

	// MetricKindQueuedDurationSeconds ..
	MetricKindQueuedDurationSeconds

	// MetricKindRunCount ..
	MetricKindRunCount

	// MetricKindStatus ..
	MetricKindStatus

	// MetricKindTimestamp ..
	MetricKindTimestamp
)

type Metrics

type Metrics map[MetricKey]Metric

Metrics ..

type Pipeline

type Pipeline struct {
	ID                    int
	Coverage              float64
	Timestamp             float64
	DurationSeconds       float64
	QueuedDurationSeconds float64
	Status                string
	Variables             string
}

Pipeline ..

func NewPipeline

func NewPipeline(gp goGitlab.Pipeline) Pipeline

NewPipeline ..

type Project

type Project struct {
	config.Project

	Topics string
}

Project ..

func NewProject added in v0.5.0

func NewProject(name string) Project

NewProject ..

func (Project) Key

func (p Project) Key() ProjectKey

Key ..

type ProjectKey

type ProjectKey string

ProjectKey ..

type Projects

type Projects map[ProjectKey]Project

Projects ..

type Ref

type Ref struct {
	Kind           RefKind
	Name           string
	Project        Project
	LatestPipeline Pipeline
	LatestJobs     Jobs
}

Ref is what we will use a metrics entity on which we will perform regular pulling operations

func NewRef

func NewRef(
	project Project,
	kind RefKind,
	name string,
) Ref

NewRef is an helper which returns a new Ref

func (Ref) DefaultLabelsValues

func (ref Ref) DefaultLabelsValues() map[string]string

DefaultLabelsValues ..

func (Ref) Key

func (ref Ref) Key() RefKey

Key ..

type RefKey

type RefKey string

RefKey ..

type RefKind

type RefKind string

RefKind is used to determine the kind of the ref

const (

	// RefKindBranch refers to a branch
	RefKindBranch RefKind = "branch"

	// RefKindTag refers to a tag
	RefKindTag RefKind = "tag"

	// RefKindMergeRequest refers to a tag
	RefKindMergeRequest RefKind = "merge-request"
)

type Refs

type Refs map[RefKey]Ref

Refs allows us to keep track of all the Ref we have configured/discovered

func (Refs) Count

func (refs Refs) Count() int

Count returns the amount of projects refs in the map

type Runner added in v0.4.6

type Runner struct {
	Description string
}

Runner ..

Jump to

Keyboard shortcuts

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