mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 02:30:45 +00:00
Merge pull request #1274 from weaveworks/1267-one-load
Remove load5 and load15
This commit is contained in:
@@ -19,8 +19,6 @@ const (
|
||||
KernelVersion = "kernel_version"
|
||||
Uptime = "uptime"
|
||||
Load1 = "load1"
|
||||
Load5 = "load5"
|
||||
Load15 = "load15"
|
||||
CPUUsage = "host_cpu_usage_percent"
|
||||
MemoryUsage = "host_mem_usage_bytes"
|
||||
)
|
||||
|
||||
@@ -22,8 +22,6 @@ func TestReporter(t *testing.T) {
|
||||
timestamp = time.Now()
|
||||
metrics = report.Metrics{
|
||||
host.Load1: report.MakeMetric().Add(timestamp, 1.0),
|
||||
host.Load5: report.MakeMetric().Add(timestamp, 5.0),
|
||||
host.Load15: report.MakeMetric().Add(timestamp, 15.0),
|
||||
host.CPUUsage: report.MakeMetric().Add(timestamp, 30.0).WithMax(100.0),
|
||||
host.MemoryUsage: report.MakeMetric().Add(timestamp, 60.0).WithMax(100.0),
|
||||
}
|
||||
|
||||
@@ -44,18 +44,8 @@ var GetLoad = func(now time.Time) report.Metrics {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
five, err := strconv.ParseFloat(matches[0][2], 64)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
fifteen, err := strconv.ParseFloat(matches[0][3], 64)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return report.Metrics{
|
||||
Load1: report.MakeMetric().Add(now, one),
|
||||
Load5: report.MakeMetric().Add(now, five),
|
||||
Load15: report.MakeMetric().Add(now, fifteen),
|
||||
Load1: report.MakeMetric().Add(now, one),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,18 +44,8 @@ var GetLoad = func(now time.Time) report.Metrics {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
five, err := strconv.ParseFloat(toks[1], 64)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
fifteen, err := strconv.ParseFloat(toks[2], 64)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return report.Metrics{
|
||||
Load1: report.MakeMetric().Add(now, one),
|
||||
Load5: report.MakeMetric().Add(now, five),
|
||||
Load15: report.MakeMetric().Add(now, fifteen),
|
||||
Load1: report.MakeMetric().Add(now, one),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ func TestGetKernelVersion(t *testing.T) {
|
||||
|
||||
func TestGetLoad(t *testing.T) {
|
||||
have := host.GetLoad(time.Now())
|
||||
if len(have) != 3 {
|
||||
t.Fatalf("Expected 3 metrics, but got: %v", have)
|
||||
if len(have) != 1 {
|
||||
t.Fatalf("Expected 1 metrics, but got: %v", have)
|
||||
}
|
||||
for key, metric := range have {
|
||||
if metric.Len() != 1 {
|
||||
|
||||
@@ -27,9 +27,7 @@ var labels = map[string]string{
|
||||
host.CPUUsage: "CPU",
|
||||
host.HostName: "Hostname",
|
||||
host.KernelVersion: "Kernel version",
|
||||
host.Load15: "Load (15m)",
|
||||
host.Load1: "Load (1m)",
|
||||
host.Load5: "Load (5m)",
|
||||
host.LocalNetworks: "Local Networks",
|
||||
host.MemoryUsage: "Memory",
|
||||
host.OS: "OS",
|
||||
|
||||
@@ -32,8 +32,6 @@ var (
|
||||
{ID: host.CPUUsage, Format: percentFormat},
|
||||
{ID: host.MemoryUsage, Format: filesizeFormat},
|
||||
{ID: host.Load1, Format: defaultFormat, Group: "load"},
|
||||
{ID: host.Load5, Format: defaultFormat, Group: "load"},
|
||||
{ID: host.Load15, Format: defaultFormat, Group: "load"},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -84,18 +84,6 @@ func TestNodeMetrics(t *testing.T) {
|
||||
Value: 0.09,
|
||||
Metric: &fixture.ClientHostLoad1Metric,
|
||||
},
|
||||
{
|
||||
ID: host.Load5,
|
||||
Group: "load",
|
||||
Value: 0.10,
|
||||
Metric: &fixture.ClientHostLoad5Metric,
|
||||
},
|
||||
{
|
||||
ID: host.Load15,
|
||||
Group: "load",
|
||||
Value: 0.11,
|
||||
Metric: &fixture.ClientHostLoad15Metric,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -77,18 +77,6 @@ func TestMakeDetailedHostNode(t *testing.T) {
|
||||
Value: 0.09,
|
||||
Metric: &fixture.ClientHostLoad1Metric,
|
||||
},
|
||||
{
|
||||
ID: host.Load5,
|
||||
Group: "load",
|
||||
Value: 0.10,
|
||||
Metric: &fixture.ClientHostLoad5Metric,
|
||||
},
|
||||
{
|
||||
ID: host.Load15,
|
||||
Group: "load",
|
||||
Value: 0.11,
|
||||
Metric: &fixture.ClientHostLoad15Metric,
|
||||
},
|
||||
},
|
||||
},
|
||||
Controls: []detailed.ControlInstance{},
|
||||
|
||||
@@ -105,14 +105,10 @@ var (
|
||||
ClientHostCPUMetric = report.MakeMetric().Add(Now, 0.07).WithFirst(Now.Add(-7 * time.Second))
|
||||
ClientHostMemoryMetric = report.MakeMetric().Add(Now, 0.08).WithFirst(Now.Add(-8 * time.Second))
|
||||
ClientHostLoad1Metric = report.MakeMetric().Add(Now, 0.09).WithFirst(Now.Add(-9 * time.Second))
|
||||
ClientHostLoad5Metric = report.MakeMetric().Add(Now, 0.10).WithFirst(Now.Add(-10 * time.Second))
|
||||
ClientHostLoad15Metric = report.MakeMetric().Add(Now, 0.11).WithFirst(Now.Add(-11 * time.Second))
|
||||
|
||||
ServerHostCPUMetric = report.MakeMetric().Add(Now, 0.12).WithFirst(Now.Add(-12 * time.Second))
|
||||
ServerHostMemoryMetric = report.MakeMetric().Add(Now, 0.13).WithFirst(Now.Add(-13 * time.Second))
|
||||
ServerHostLoad1Metric = report.MakeMetric().Add(Now, 0.14).WithFirst(Now.Add(-14 * time.Second))
|
||||
ServerHostLoad5Metric = report.MakeMetric().Add(Now, 0.15).WithFirst(Now.Add(-15 * time.Second))
|
||||
ServerHostLoad15Metric = report.MakeMetric().Add(Now, 0.16).WithFirst(Now.Add(-16 * time.Second))
|
||||
|
||||
Report = report.Report{
|
||||
ID: "test-report",
|
||||
@@ -322,8 +318,6 @@ var (
|
||||
host.CPUUsage: ClientHostCPUMetric,
|
||||
host.MemoryUsage: ClientHostMemoryMetric,
|
||||
host.Load1: ClientHostLoad1Metric,
|
||||
host.Load5: ClientHostLoad5Metric,
|
||||
host.Load15: ClientHostLoad15Metric,
|
||||
}),
|
||||
ServerHostNodeID: report.MakeNodeWith(map[string]string{
|
||||
"host_name": ServerHostName,
|
||||
@@ -335,8 +329,6 @@ var (
|
||||
host.CPUUsage: ServerHostCPUMetric,
|
||||
host.MemoryUsage: ServerHostMemoryMetric,
|
||||
host.Load1: ServerHostLoad1Metric,
|
||||
host.Load5: ServerHostLoad5Metric,
|
||||
host.Load15: ServerHostLoad15Metric,
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user