github.com/cilium/cilium@v1.16.2/pkg/datapath/loader/metrics/metrics.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package metrics 5 6 import ( 7 "github.com/cilium/cilium/pkg/spanstat" 8 ) 9 10 // SpanStat is a statistics structure for storing metrics related to datapath 11 // load operations. 12 type SpanStat struct { 13 BpfCompilation spanstat.SpanStat 14 BpfWaitForELF spanstat.SpanStat 15 BpfLoadProg spanstat.SpanStat 16 } 17 18 // GetMap returns a map of statistic names to stats 19 func (s *SpanStat) GetMap() map[string]*spanstat.SpanStat { 20 return map[string]*spanstat.SpanStat{ 21 "bpfCompilation": &s.BpfCompilation, 22 "bpfWaitForELF": &s.BpfWaitForELF, 23 "bpfLoadProg": &s.BpfLoadProg, 24 } 25 }