mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 23:19:46 -08:00
commit
3d7658eea5
|
@ -40,4 +40,3 @@ func NewInterruptsCollector() (Collector, error) {
|
|||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ sysctl_intr(struct intr *intr, int idx)
|
|||
*/
|
||||
import "C"
|
||||
|
||||
|
||||
var (
|
||||
interruptLabelNames = []string{"CPU", "type", "devices"}
|
||||
)
|
||||
|
|
|
@ -36,7 +36,7 @@ var (
|
|||
OutgoingBytes: 0,
|
||||
}
|
||||
expectedIPVSBackendStatuses = []procfs.IPVSBackendStatus{
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.22"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.82.22"),
|
||||
|
@ -46,7 +46,7 @@ var (
|
|||
ActiveConn: 248,
|
||||
InactConn: 2,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.22"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.83.24"),
|
||||
|
@ -56,7 +56,7 @@ var (
|
|||
ActiveConn: 248,
|
||||
InactConn: 2,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.22"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.83.21"),
|
||||
|
@ -66,7 +66,7 @@ var (
|
|||
ActiveConn: 248,
|
||||
InactConn: 1,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.57"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.84.22"),
|
||||
|
@ -76,7 +76,7 @@ var (
|
|||
ActiveConn: 0,
|
||||
InactConn: 0,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.57"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.82.21"),
|
||||
|
@ -86,7 +86,7 @@ var (
|
|||
ActiveConn: 1499,
|
||||
InactConn: 0,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.57"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.50.21"),
|
||||
|
@ -96,7 +96,7 @@ var (
|
|||
ActiveConn: 1498,
|
||||
InactConn: 0,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.55"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.50.26"),
|
||||
|
@ -106,7 +106,7 @@ var (
|
|||
ActiveConn: 0,
|
||||
InactConn: 0,
|
||||
},
|
||||
procfs.IPVSBackendStatus{
|
||||
{
|
||||
LocalAddress: net.ParseIP("192.168.0.55"),
|
||||
LocalPort: 3306,
|
||||
RemoteAddress: net.ParseIP("192.168.49.32"),
|
||||
|
|
|
@ -25,13 +25,13 @@ func TestMdadm(t *testing.T) {
|
|||
}
|
||||
|
||||
refs := map[string]mdStatus{
|
||||
"md3": mdStatus{"md3", true, 8, 8, 5853468288, 5853468288},
|
||||
"md127": mdStatus{"md127", true, 2, 2, 312319552, 312319552},
|
||||
"md0": mdStatus{"md0", true, 2, 2, 248896, 248896},
|
||||
"md4": mdStatus{"md4", false, 2, 2, 4883648, 4883648},
|
||||
"md6": mdStatus{"md6", true, 1, 2, 195310144, 16775552},
|
||||
"md8": mdStatus{"md8", true, 2, 2, 195310144, 16775552},
|
||||
"md7": mdStatus{"md7", true, 3, 4, 7813735424, 7813735424},
|
||||
"md3": {"md3", true, 8, 8, 5853468288, 5853468288},
|
||||
"md127": {"md127", true, 2, 2, 312319552, 312319552},
|
||||
"md0": {"md0", true, 2, 2, 248896, 248896},
|
||||
"md4": {"md4", false, 2, 2, 4883648, 4883648},
|
||||
"md6": {"md6", true, 1, 2, 195310144, 16775552},
|
||||
"md8": {"md8", true, 2, 2, 195310144, 16775552},
|
||||
"md7": {"md7", true, 3, 4, 7813735424, 7813735424},
|
||||
}
|
||||
|
||||
for _, md := range mdStates {
|
||||
|
|
|
@ -77,4 +77,3 @@ func (c *netDevCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ package collector
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"strconv"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"github.com/prometheus/common/log"
|
||||
)
|
||||
|
|
|
@ -17,8 +17,8 @@ package collector
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"strconv"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"github.com/prometheus/common/log"
|
||||
)
|
||||
|
|
|
@ -38,7 +38,6 @@ type statCollector struct {
|
|||
procsBlocked *prometheus.Desc
|
||||
}
|
||||
|
||||
|
||||
func init() {
|
||||
Factories["stat"] = NewStatCollector
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily {
|
|||
mtimeMetricFamily.Metric = append(mtimeMetricFamily.Metric,
|
||||
&dto.Metric{
|
||||
Label: []*dto.LabelPair{
|
||||
&dto.LabelPair{
|
||||
{
|
||||
Name: proto.String("file"),
|
||||
Value: proto.String(filename),
|
||||
},
|
||||
|
@ -145,7 +145,7 @@ func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily {
|
|||
Help: proto.String("1 if there was an error opening or reading a file, 0 otherwise"),
|
||||
Type: dto.MetricType_GAUGE.Enum(),
|
||||
Metric: []*dto.Metric{
|
||||
&dto.Metric{
|
||||
{
|
||||
Gauge: &dto.Gauge{Value: &error},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue