Skip to content

Commit

Permalink
check/format
Browse files Browse the repository at this point in the history
  • Loading branch information
ledbruno committed Sep 20, 2024
1 parent 2b4a5c1 commit e4fc17b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion chaoscenter/graphql/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
// but we just won't be exposing them as metrics.

type Infra struct {
Name string
Name string
InfraNamespace string
isActive bool
PlatformName string
isActive bool
PlatformName string
}

type infraCollector struct {
Expand All @@ -28,7 +28,7 @@ type InfraProvider func() []Infra
func newInfraCollector(fn InfraProvider) *infraCollector {
return &infraCollector{
infraMetric: prometheus.NewDesc("infra_metric", "Shows chaos infra status and info", []string{"name", "namespace"}, nil),
AllInfras: fn,
AllInfras: fn,
}
}

Expand All @@ -38,10 +38,10 @@ func (collector *infraCollector) Describe(ch chan<- *prometheus.Desc) {

func (collector *infraCollector) Collect(ch chan<- prometheus.Metric) {
for _, infra := range collector.AllInfras() {
var metricValue float64 = 0
if infra.isActive {
metricValue = 1
}
var metricValue float64 = 0
if infra.isActive {
metricValue = 1
}
ch <- prometheus.MustNewConstMetric(collector.infraMetric, prometheus.GaugeValue, metricValue, infra.Name, infra.InfraNamespace)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type infraService struct {

// List all infrastructures
func (in *infraService) ListAll() ([]*dbChaosInfra.ChaosInfra, error) {
return in.infraOperator.GetAll();
return in.infraOperator.GetAll()
}

// NewChaosInfrastructureService returns a new instance of Service
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/graphql/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/config"
"github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/handlers"
"github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/projects"
"github.com/prometheus/client_golang/prometheus/promhttp"
pb "github.com/litmuschaos/litmus/chaoscenter/graphql/server/protos"
"github.com/litmuschaos/litmus/chaoscenter/graphql/server/utils"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

func init() {
Expand Down

0 comments on commit e4fc17b

Please sign in to comment.