Commit d2878368 authored by Kamil Trzciński's avatar Kamil Trzciński

Fix failures

parent 857d72e5
Pipeline #5240807 passed with stages
in 32 minutes and 36 seconds
......@@ -104,7 +104,7 @@ func (b *buildsHelper) buildsCount() int {
return len(b.builds)
}
func (b *buildsHelper) statesAndStages() (map[common.BuildRuntimeState]map[common.ShellScriptStage]int) {
func (b *buildsHelper) statesAndStages() map[common.BuildRuntimeState]map[common.ShellScriptStage]int {
b.lock.Lock()
defer b.lock.Unlock()
......
......@@ -46,13 +46,13 @@ type Build struct {
ExecutorData ExecutorData
// Unique ID for all running builds on this runner
RunnerID int `json:"runner_id"`
RunnerID int `json:"runner_id"`
// Unique ID for all running builds on this runner and this project
ProjectRunnerID int `json:"project_runner_id"`
CurrentStage ShellScriptStage
CurrentState BuildRuntimeState
CurrentStage ShellScriptStage
CurrentState BuildRuntimeState
}
func (b *Build) Log() *logrus.Entry {
......
......@@ -5,7 +5,7 @@ import (
)
var machinesDataDesc = prometheus.NewDesc("ci_machines_provider", "The current number of machines in given state.", []string{"state"}, nil)
var providerStatisticsDesc = prometheus.NewDesc("ci_machines_provided", "The total number of machines created.", []string{"type"}, nil)
var providerStatisticsDesc = prometheus.NewDesc("ci_machines", "The total number of machines created.", []string{"type"}, nil)
func (m *machineProvider) collectDetails() (data machinesData) {
m.lock.RLock()
......@@ -32,7 +32,7 @@ func (m *machineProvider) Collect(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(machinesDataDesc, prometheus.GaugeValue, float64(data.Used), "state=used")
ch <- prometheus.MustNewConstMetric(machinesDataDesc, prometheus.GaugeValue, float64(data.Removing), "state=removing")
ch <- prometheus.MustNewConstMetric(machinesDataDesc, prometheus.CounterValue, float64(m.statistics.Created), "type=created")
ch <- prometheus.MustNewConstMetric(machinesDataDesc, prometheus.CounterValue, float64(m.statistics.Used), "type=used")
ch <- prometheus.MustNewConstMetric(machinesDataDesc, prometheus.CounterValue, float64(m.statistics.Removed), "type=removed")
ch <- prometheus.MustNewConstMetric(providerStatisticsDesc, prometheus.CounterValue, float64(m.statistics.Created), "type=created")
ch <- prometheus.MustNewConstMetric(providerStatisticsDesc, prometheus.CounterValue, float64(m.statistics.Used), "type=used")
ch <- prometheus.MustNewConstMetric(providerStatisticsDesc, prometheus.CounterValue, float64(m.statistics.Removed), "type=removed")
}
......@@ -28,5 +28,5 @@ func TestMachineProviderCollect(t *testing.T) {
ch := make(chan prometheus.Metric, 50)
provider := &machineProvider{}
provider.Collect(ch)
assert.Len(t, ch, 9)
assert.Len(t, ch, 8)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment