File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
- #!/usr/bin/env python
2
- # -*- noplot -*-
3
1
import time
4
2
import matplotlib .pyplot as plt
5
3
import numpy as np
6
4
5
+
7
6
def get_memory ():
8
7
"Simulate a function that returns system memory"
9
8
return 100 * (0.5 + 0.5 * np .sin (0.5 * np .pi * time .time ()))
10
9
10
+
11
11
def get_cpu ():
12
12
"Simulate a function that returns cpu usage"
13
13
return 100 * (0.5 + 0.5 * np .sin (0.2 * np .pi * (time .time () - 0.25 )))
14
14
15
+
15
16
def get_net ():
16
17
"Simulate a function that returns network bandwidth"
17
18
return 100 * (0.5 + 0.5 * np .sin (0.7 * np .pi * (time .time () - 0.1 )))
18
19
20
+
19
21
def get_stats ():
20
22
return get_memory (), get_cpu (), get_net ()
21
23
24
+
22
25
# turn interactive mode on for dynamic updates. If you aren't in
23
26
# interactive mode, you'll need to use a GUI event handler/timer.
24
27
plt .ion ()
You can’t perform that action at this time.
0 commit comments