forked from rustyrazorblade/killranalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathterm.py
More file actions
executable file
·49 lines (35 loc) · 898 Bytes
/
Copy pathterm.py
File metadata and controls
executable file
·49 lines (35 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
from blessings import Terminal
import collections
from kafka import KafkaConsumer
site = "02559c4f-ec20-4579-b2ca-72922a90d0df"
class DrawState(object):
term = None
latest_samples = None
consumer = None
def __init__(self, term):
self.term = term
self.latest_samples = collections.deque(maxlen=20)
self.consumer = KafkaConsumer("")
def draw(self):
# read in any state from kafka
self.draw_hits_graph()
def draw_hits_graph(self):
pass
def draw_stats_top_view(self):
"""
draws stats to terminal in a top-style view
grouped by stat?
pages hits
blah 50
blah2 100
OS
whatever
:return:
"""
pass
def main():
term = Terminal()
ds = DrawState(term)
while True:
ds.draw()