(name string)
| 136 | } |
| 137 | |
| 138 | func (c *netClassCollector) getFieldDesc(name string) *prometheus.Desc { |
| 139 | c.metricDescsMu.Lock() |
| 140 | defer c.metricDescsMu.Unlock() |
| 141 | |
| 142 | fieldDesc, exists := c.metricDescs[name] |
| 143 | |
| 144 | if !exists { |
| 145 | fieldDesc = prometheus.NewDesc( |
| 146 | prometheus.BuildFQName(namespace, c.subsystem, name), |
| 147 | fmt.Sprintf("Network device property: %s", name), |
| 148 | []string{"device"}, |
| 149 | nil, |
| 150 | ) |
| 151 | c.metricDescs[name] = fieldDesc |
| 152 | } |
| 153 | |
| 154 | return fieldDesc |
| 155 | } |
| 156 | |
| 157 | func (c *netClassCollector) getNetClassInfo() (sysfs.NetClass, error) { |
| 158 | netClass := sysfs.NetClass{} |
no outgoing calls
no test coverage detected