7a7144f881c00dd2496fa01254530c9aeed47e19
[bottlenecks.git] / utils / dashboard / process_data.py
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd. and others
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10
11 import subprocess as subp
12 import sys
13 from collector import Collector
14 from uploader import Uploader
15
16
17 #process data
18 if len(sys.argv)!=3:
19     print "Wrong arguments, please input 2 parameters, 1st as raw data path; "\
20     "2nd as config yaml!!"
21     exit (1)
22 data_home = sys.argv[1]
23 conf = sys.argv[2]
24
25 #1collect result
26 result = Collector().collect_data(data_home)
27 print "Result collected:\n%s" % result
28
29 #2upload result
30 Uploader(conf).upload_result("rubbos", result)
31