1 /* Copyright (C) 2014 InfiniDB, Inc.
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License
5 as published by the Free Software Foundation; version 2 of
6 the License.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 MA 02110-1301, USA. */
17
18 #include <iostream>
19 using namespace std;
20
21 #include <boost/uuid/uuid.hpp>
22 #include <boost/uuid/uuid_generators.hpp>
23 namespace bu = boost::uuids;
24
25 #include "querytele.h"
26 using namespace querytele;
27
main(int argc,char ** argv)28 int main(int argc, char** argv)
29 {
30 bu::random_generator rg;
31 QueryTeleServerParms qtsp;
32 qtsp.host = "localhost";
33 qtsp.port = 9090;
34 QueryTeleClient qtc(qtsp);
35 QueryTeleClient qtc1(qtc);
36 QueryTeleClient qtc2;
37 qtc2 = qtc;
38 QueryTeleStats qts;
39 qts.query_uuid = rg();
40 qts.msg_type = QueryTeleStats::QT_START;
41 qts.query = "SELECT * FROM NATION;";
42 qtc.postQueryTele(qts);
43
44 sleep(1);
45
46 StepTeleStats sts;
47 sts.query_uuid = qts.query_uuid;
48 sts.step_uuid = rg();
49 sts.msg_type = StepTeleStats::ST_START;
50 qtc.postStepTele(sts);
51
52 sleep(1);
53
54 sts.msg_type = StepTeleStats::ST_PROGRESS;
55 qtc.postStepTele(sts);
56
57 sleep(1);
58
59 sts.msg_type = StepTeleStats::ST_SUMMARY;
60 qtc.postStepTele(sts);
61
62 sleep(1);
63
64 qts.msg_type = QueryTeleStats::QT_SUMMARY;
65 qtc.postQueryTele(qts);
66
67 sleep(20);
68
69 return 0;
70 }
71
72