Documentation ¶
Index ¶
- type CircleCIEnvironment
- type Config
- type JenkinsCIEnvironment
- type Point
- func (p *Point) RecordNodeWait(err error)
- func (p *Point) RecordProvisionError()
- func (p *Point) RecordProvisionSuccess()
- func (p *Point) RecordTestError()
- func (p *Point) RecordTestSuccess()
- func (p *Point) RecordTotalTime()
- func (p *Point) SetNodeWaitStart()
- func (p *Point) SetProvisionMetrics(data []byte)
- func (p *Point) SetProvisionStart()
- func (p *Point) SetTestStart()
- func (p *Point) Write()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircleCIEnvironment ¶
type CircleCIEnvironment struct { Branch string `envconfig:"CIRCLE_BRANCH"` BuildNumber string `envconfig:"CIRCLE_BUILD_NUM"` CommitSha string `envconfig:"CIRCLE_SHA1"` Job string `envconfig:"CIRCLE_JOB"` }
CircleCIEnvironment holds information about a test run within circleci
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"` IsCircle bool `envconfig:"CIRCLECI"` JenkinsURL string `envconfig:"JENKINS_URL"` CircleEnv *CircleCIEnvironment JenkinsEnv *JenkinsCIEnvironment }
Config holds information on how to talk to influxdb
func ParseConfig ¶
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 ¶
BuildPoint scaffolds a point object that stores information before being written to influx
func (*Point) RecordNodeWait ¶
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 ¶
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()