Add new udafs and RMR support to gsprintconsole_ves
[com/gs-lite.git] / demo / PIPE / gen_data.py
1 import random
2 import time
3
4 ipv4s = ["1.2.3.4", "3.4.5.6", "112.221.54.34", "66.77.88.99"]
5 ipv6s = ["1234:4321:5678:8765:9abc:cba9:def0:0def",
6          "2234:4321:5678:8765:9abc:cba9:def0:0de2",
7         "3234:4321:5678:8765:9abc:cba9:def0:0de3",
8         "4234:4321:5678:8765:9abc:cba9:def0:0de4" ]
9
10 strings = ["foo", "bar", "zed", "flip", "flood"]
11 bools = ["TRUE", "FALSE"]
12
13 tstart = int(time.time())
14 tend = tstart+50
15 rec_per_ts = 5
16
17 for ts in xrange(tstart, tend+1):
18         for rno in xrange(0, rec_per_ts):
19                 v2 = str(random.randint(1,100000))
20                 v3 = ipv4s[random.randrange(0,len(ipv4s))]
21                 v4 = ipv6s[random.randrange(0,len(ipv6s))]
22                 v5 = strings[random.randrange(0,len(strings))]
23                 v6 = bools[random.randrange(0,len(bools))]
24                 v7 = str(random.randint(1,100000))
25                 v8 = str(random.randint(1,100000))
26                 v9 = str(random.uniform(1,100000))
27                 rec = [str(ts), v2, v3, v4, v5, v6, v7, v8, v9]
28                 print ",".join(rec)
29