metrics

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address    string `envconfig:"INFLUX_ADDRESS" required:"true"`
	Username   string `envconfig:"INFLUX_USERNAME" required:"true"`
	Password   string `envconfig:"INFLUX_PASSWORD" required:"true"`
	Database   string `envconfig:"INFLUX_DATABASE" required:"true"`
	IsJenkins  bool   `envconfig:"IS_JENKINS"`
	JenkinsEnv *JenkinsCIEnvironment
}

Config holds information on how to talk to influxdb

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig will parse needed environment variables for running the tests

type JenkinsCIEnvironment

type JenkinsCIEnvironment struct {
	Branch      string `envconfig:"GIT_BRANCH"`
	BuildNumber string `envconfig:"BUILD_NUMBER"`
	CommitSha   string `envconfig:"GIT_COMMIT"`
	Job         string `envconfig:"JOB_NAME"`
}

JenkinsCIEnvironment holds information about a test run within jenkins

type Point

type Point struct {
	ProvisionStart      time.Time
	NodeWaitStart       time.Time
	TestStart           time.Time
	OverallStart        time.Time
	ProvisionDuration   time.Duration
	NodeWaitDuration    time.Duration
	TestDuration        time.Duration
	OverallDuration     time.Duration
	TestErrorCount      float64
	ProvisionErrorCount float64
	NodeWaitErrorCount  float64
	Tags                map[string]string
}

Point holds data that will be written to influx

func BuildPoint

func BuildPoint(orchestrator, location, clusterDefinition, subscriptionID string) *Point

BuildPoint scaffolds a point object that stores information before being written to influx

func (*Point) RecordNodeWait

func (p *Point) RecordNodeWait(err error)

RecordNodeWait will set NodeWaitDuration to time.Since(p.NodeWaitStart)

func (*Point) RecordProvisionError

func (p *Point) RecordProvisionError()

RecordProvisionError sets appropriate values for when a test error occurs

func (*Point) RecordProvisionSuccess

func (p *Point) RecordProvisionSuccess()

RecordProvisionSuccess sets TestErrorCount to 0 to mark tests succeeded

func (*Point) RecordTestError

func (p *Point) RecordTestError()

RecordTestError sets appropriate values for when a test error occurs

func (*Point) RecordTestSuccess

func (p *Point) RecordTestSuccess()

RecordTestSuccess sets TestErrorCount to 0 to mark tests succeeded

func (*Point) RecordTotalTime

func (p *Point) RecordTotalTime()

RecordTotalTime captures total runtime of tests

func (*Point) SetNodeWaitStart

func (p *Point) SetNodeWaitStart()

SetNodeWaitStart will set NodeWaitStart value to time.Now()

func (*Point) SetProvisionMetrics

func (p *Point) SetProvisionMetrics(data []byte)

SetProvisionMetrics will parse the csv data retrieved from /opt/m and set appropriate fields

func (*Point) SetProvisionStart

func (p *Point) SetProvisionStart()

SetProvisionStart will set ProvisionStart value to time.Now()

func (*Point) SetTestStart

func (p *Point) SetTestStart()

SetTestStart will set TestStart value to time.Now()

func (*Point) Write

func (p *Point) Write()

Jump to

Keyboard shortcuts

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