mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Use slices instead of linked lists for Metric
Also: * Remove Gob encoder/decoder * Stop using custom encoders/decoders for Timestamps (both ugorji and the Golang JSON codecs use nanosecond precision). * Use idiomatic way to check for existence in metric.LastSample()
This commit is contained in:
@@ -62,7 +62,7 @@ func TestReporter(t *testing.T) {
|
||||
}
|
||||
if memoryUsage, ok := node.Metrics[process.MemoryUsage]; !ok {
|
||||
t.Errorf("Expected memory usage metric, but not found")
|
||||
} else if sample := memoryUsage.LastSample(); sample == nil {
|
||||
} else if sample, ok := memoryUsage.LastSample(); !ok {
|
||||
t.Errorf("Expected memory usage metric to have a sample, but there were none")
|
||||
} else if sample.Value != 0. {
|
||||
t.Errorf("Expected memory usage metric sample %f, got %f", 0., sample.Value)
|
||||
|
||||
Reference in New Issue
Block a user