fix: apply go fmt formatting

This commit is contained in:
Zach Kelling
2026-02-13 16:09:16 -08:00
parent 6a26157e57
commit 99f5fc95d0
4 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -22,4 +22,4 @@ func (errs *Errs) Add(errors ...error) {
}
}
}
}
}
+10 -10
View File
@@ -16,28 +16,28 @@ func GatherGoMetrics() ([]*MetricFamily, error) {
families := []*MetricFamily{
{
Name: "go_goroutines",
Type: MetricTypeGauge,
Name: "go_goroutines",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: float64(runtime.NumGoroutine())}}},
},
{
Name: "go_memstats_alloc_bytes",
Type: MetricTypeGauge,
Name: "go_memstats_alloc_bytes",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: float64(ms.Alloc)}}},
},
{
Name: "go_memstats_sys_bytes",
Type: MetricTypeGauge,
Name: "go_memstats_sys_bytes",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: float64(ms.Sys)}}},
},
{
Name: "go_memstats_heap_objects",
Type: MetricTypeGauge,
Name: "go_memstats_heap_objects",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: float64(ms.HeapObjects)}}},
},
{
Name: "go_memstats_last_gc_time_seconds",
Type: MetricTypeGauge,
Name: "go_memstats_last_gc_time_seconds",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: float64(ms.LastGC) / float64(time.Second)}}},
},
}
+1 -1
View File
@@ -50,4 +50,4 @@ func TestGlobalMetricFunctions(t *testing.T) {
t.Error("Expected non-nil gauge vec")
}
gaugeVec.WithLabelValues("value").Set(100)
}
}
+6 -6
View File
@@ -16,24 +16,24 @@ func GatherProcessMetrics(opts ProcessCollectorOpts) ([]*MetricFamily, error) {
families := []*MetricFamily{
{
Name: "process_start_time_seconds",
Type: MetricTypeGauge,
Name: "process_start_time_seconds",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: start}}},
},
}
if cpu, ok := processCPUSeconds(); ok {
families = append(families, &MetricFamily{
Name: "process_cpu_seconds_total",
Type: MetricTypeCounter,
Name: "process_cpu_seconds_total",
Type: MetricTypeCounter,
Metrics: []Metric{{Value: MetricValue{Value: cpu}}},
})
}
if rss, ok := processResidentBytes(); ok {
families = append(families, &MetricFamily{
Name: "process_resident_memory_bytes",
Type: MetricTypeGauge,
Name: "process_resident_memory_bytes",
Type: MetricTypeGauge,
Metrics: []Metric{{Value: MetricValue{Value: rss}}},
})
}