summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/prometheus/procfs/stat_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-06-21 19:06:17 -0700
committerCorey Hulen <corey@hulen.com>2017-06-21 19:06:17 -0700
commit42f28ab8e374137fe3f5d25424489d879d4724f8 (patch)
tree20353f2446b506d32e6d353b72a57bf48f070389 /vendor/github.com/prometheus/procfs/stat_test.go
parent6b39c308d882a0aeac533f8ab1d90b48a2ae4b5a (diff)
downloadchat-42f28ab8e374137fe3f5d25424489d879d4724f8.tar.gz
chat-42f28ab8e374137fe3f5d25424489d879d4724f8.tar.bz2
chat-42f28ab8e374137fe3f5d25424489d879d4724f8.zip
Updating server dependancies (#6712)
Diffstat (limited to 'vendor/github.com/prometheus/procfs/stat_test.go')
-rw-r--r--vendor/github.com/prometheus/procfs/stat_test.go51
1 files changed, 49 insertions, 2 deletions
diff --git a/vendor/github.com/prometheus/procfs/stat_test.go b/vendor/github.com/prometheus/procfs/stat_test.go
index 6eb792478..c34ccce1a 100644
--- a/vendor/github.com/prometheus/procfs/stat_test.go
+++ b/vendor/github.com/prometheus/procfs/stat_test.go
@@ -8,7 +8,54 @@ func TestStat(t *testing.T) {
t.Fatal(err)
}
- if want, have := int64(1418183276), s.BootTime; want != have {
- t.Errorf("want boot time %d, have %d", want, have)
+ // cpu
+ if want, have := float64(301854)/userHZ, s.CPUTotal.User; want != have {
+ t.Errorf("want cpu/user %v, have %v", want, have)
}
+ if want, have := float64(31)/userHZ, s.CPU[7].SoftIRQ; want != have {
+ t.Errorf("want cpu7/softirq %v, have %v", want, have)
+ }
+
+ // intr
+ if want, have := uint64(8885917), s.IRQTotal; want != have {
+ t.Errorf("want irq/total %d, have %d", want, have)
+ }
+ if want, have := uint64(1), s.IRQ[8]; want != have {
+ t.Errorf("want irq8 %d, have %d", want, have)
+ }
+
+ // ctxt
+ if want, have := uint64(38014093), s.ContextSwitches; want != have {
+ t.Errorf("want context switches (ctxt) %d, have %d", want, have)
+ }
+
+ // btime
+ if want, have := uint64(1418183276), s.BootTime; want != have {
+ t.Errorf("want boot time (btime) %d, have %d", want, have)
+ }
+
+ // processes
+ if want, have := uint64(26442), s.ProcessCreated; want != have {
+ t.Errorf("want process created (processes) %d, have %d", want, have)
+ }
+
+ // procs_running
+ if want, have := uint64(2), s.ProcessesRunning; want != have {
+ t.Errorf("want processes running (procs_running) %d, have %d", want, have)
+ }
+
+ // procs_blocked
+ if want, have := uint64(1), s.ProcessesBlocked; want != have {
+ t.Errorf("want processes blocked (procs_blocked) %d, have %d", want, have)
+ }
+
+ // softirq
+ if want, have := uint64(5057579), s.SoftIRQTotal; want != have {
+ t.Errorf("want softirq total %d, have %d", want, have)
+ }
+
+ if want, have := uint64(508444), s.SoftIRQ.Rcu; want != have {
+ t.Errorf("want softirq RCU %d, have %d", want, have)
+ }
+
}