-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgettingTestData.py
79 lines (68 loc) · 5.89 KB
/
gettingTestData.py
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from pymongo import MongoClient
from bson.objectid import ObjectId
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-whitegrid')
def getMongodb():
client = MongoClient('mongodb://qaubd1:27017')
db = client.prf
return db
def getMongoConnections(connection):
db = getMongodb()
conn = ''
if connection == 'builds':
conn = db.builds
elif connection == 'benchmarks':
conn = db.benchmarks
elif connection == 'results':
conn = db.results
return conn
def getBeanchmarks():
conn = getMongoConnections('benchmarks')
# results = conn.find({}, {'id': 1, 'bmark_group': 1, 'bmark_name': 1})
results = conn.find().sort([('bmark_group', -1)]).limit(2)
return results
def getBuilds():
conn = getMongoConnections('builds')
# results = conn.find({},{'_id': 1, 'name': 1})
results = conn.find().sort([('name', -1)]).limit(2)
return results
if __name__ == '__main__':
plt.style.use('seaborn-whitegrid')
conn1 = getMongoConnections('results')
conn2 = getMongoConnections('builds')
results = conn1.find({"bmark_id": ObjectId("5b2274ce4fbd0333c3cb1b47")})
build = []
score = []
for result in results:
for x in conn2.find({"_id": ObjectId(result['build_id'])}):
try:
build_no = x['name'].split('-')[2]
if len(build_no) == 4:
score.append(float(result["results"]["RN_loop_results_warmup_time"][0]))
build.append(float(build_no))
else:
continue
except:
pass
print(build)
print(score)
# build = [10, 20, 30, 40, 50, 60, 80, 100]
# score = [5000.00, 3000.00, 6000.00, 1000.00, 3000.00, 5000.00, 3000.00, 3000.00]
# build = ['2506', '2509', '2512', '2513', '2514', '2517', '2521', '2522', '2523', '2524', '2526', '2527', '2529', '2530', '2534', '2535', '2542', '2543', '2544', '2545', '2549', '2568', '2569', '2570', '2571', '2572', '2573', '2574', '2575', '2576', '2577', '2578', '2579', '2580', '2581', '2582', '2583', '2584', '2585', '2586', '2587', '2589', '2593', '2597', '2599', '2605', '2607', '2608', '2611', '2612', '2613', '2619', '2630', '2631', '2633', '2634', '2641', '2644', '2646', '2648', '2650', '2651', '2654', '2656', '2657', '2659', '2661', '2663', '2665', '2671', '2679', '2680', '2681', '2682', '2683', '2684', '2685', '2686', '2687', '2689', '2690', '2691', '2692', '2694', '2695', '2696', '2698', '2699', '2700', '2701', '2702', '2704', '2708', '2709', '2710', '2714', '2715', '2716', '2717', '2718', '2719', '2720', '2721', '2722', '2723', '2724', '2726', '2729', '2730', '2731', '2732', '2733', '2734', '2735', '2737', '2738', '2739', '2741', '2742', '2743', '2744', '2745', '2746', '2747', '2748', '2749', '2750', '2751', '2752', '2753', '2754', '2755', '2756', '2757', '2758', '2759', '2760', '2762', '2763', '2764', '2765', '2766', '2767', '2768', '2769', '2770', '2771', '2772', '2774', '2775', '2776', '2777', '2778', '2779', '2780', '2785', '2786', '2787', '2788', '2789', '2790', '2791', '2792', '2793', '2794', '2795', '2796', '2799', '2800', '2801', '2802', '2803', '2804', '2805', '2809', '2810', '2812', '2813', '2814', '2815', '2816', '2817', '2818', '2819', '2821', '2822', '2823', '2824', '2825', '2826', '2827', '2828', '2830', '2831', '2832', '2833', '2835', '2836', '2837', '2839', '2840', '2841', '2843']
# score = ['0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '6269.00', '6220.00', '6404.00', '6297.00', '6256.00', '6416.00', '6291.00', '6275.00', '6256.00', '6196.00', '6281.00', '6277.00', '5432.00', '6213.00', '6244.00', '6371.00', '6461.00', '6258.00', '6390.00', '6369.00', '6226.00', '6306.00', '6193.00', '6304.00', '6321.00', '6292.00', '6207.00', '6406.00', '6251.00', '6314.00', '6298.00', '6247.00', '6327.00', '6255.00', '6264.00', '6442.00', '6261.00', '6337.00', '6269.00', '-1.00', '6295.00', '6269.00', '6401.00', '6570.00', '5836.00', '5843.00', '6217.00', '6210.00', '6124.00', '6116.00', '6085.00', '6171.00', '6026.00', '6140.00', '6064.00', '5970.00', '5810.00', '5853.00', '5881.00', '6201.00', '6076.00', '6299.00', '6049.00', '6052.00', '5968.00', '6200.00', '6133.00', '5939.00', '6151.00', '6198.00', '6241.00', '6216.00', '6293.00', '6130.00', '6226.00', '6185.00', '6117.00', '3045.00', '6201.00', '2611.00', '2648.00', '2594.00', '2576.00', '2527.00', '2606.00', '11054.00', '2711.00', '8176.00', '2750.00', '30140.00', '2811.00', '39700.00', '2553.00', '2575.00', '2622.00', '7100.00', '2622.00', '2599.00', '2701.00', '2685.00', '37319.00', '2546.00', '3212.00', '2547.00', '2907.00', '6007.00', '2555.00', '2824.00', '2591.00', '2575.00', '6028.00', '2643.00', '2457.00', '2605.00', '5902.00', '2733.00', '2642.00', '3358.00', '2523.00', '2589.00', '2592.00', '5995.00', '5905.00', '2747.00', '2626.00', '2493.00', '2579.00', '2897.00', '2842.00', '2756.00', '2672.00', '2700.00', '2714.00', '2671.00', '2786.00', '2554.00', '2794.00', '2559.00', '2662.00', '2654.00', '2589.00', '5918.00', '5980.00', '5762.00', '5729.00', '3389.00', '5818.00', '8485.00', '7981.00', '9659.00', '7476.00', '8339.00', '8736.00', '6096.00', '3033.00', '5895.00', '2781.00', '2751.00', '5922.00', '6042.00', '5911.00', '5890.00', '6034.00', '5877.00', '2956.00', '2649.00', '6207.00', '6000.00', '6013.00', '6064.00', '6012.00', '3458.00', '6165.00', '3194.00', '6026.00', '6099.00', '5967.00', '6091.00', '3220.00', '5943.00', '3449.00', '5910.00', '6264.00', '2782.00', '3151.00', '6014.00', '6120.00', '5775.00', '5797.00']
plt.xticks(np.arange(0, float(max(build))+5, 5))
plt.yticks(np.arange(0, float(max(score)), 5000))
# plt.plot(build[0:20], score[0:20])
plt.plot(build, score)
plt.show()
# # importing pandas as pd
# import pandas as pd
#
# # dictionary of lists
# dict = {'build': build, 'score': score}
#
# df = pd.DataFrame(dict)
#
# # saving the dataframe
# df.to_csv('test.csv', header=False, index=False)