mirror of
https://github.com/luxfi/metric.git
synced 2026-07-27 04:12:44 +00:00
fix: apply go fmt formatting
This commit is contained in:
+10
-10
@@ -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)}}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -50,4 +50,4 @@ func TestGlobalMetricFunctions(t *testing.T) {
|
||||
t.Error("Expected non-nil gauge vec")
|
||||
}
|
||||
gaugeVec.WithLabelValues("value").Set(100)
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -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}}},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user