Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Mynij-unit-tests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
Mynij-unit-tests
Commits
bc230614
Commit
bc230614
authored
Feb 21, 2020
by
Alexandra
Committed by
Alexandra Rogova
Feb 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented nexedi's slapos python monitor for ram
parent
a707b8ca
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
610 additions
and
12027 deletions
+610
-12027
Milestone1/results/add_csv.csv
Milestone1/results/add_csv.csv
+256
-256
Milestone1/results/add_csv_monitor.csv
Milestone1/results/add_csv_monitor.csv
+277
-11521
Milestone1/results/test.csv
Milestone1/results/test.csv
+0
-217
Milestone1/run.js
Milestone1/run.js
+2
-0
Milestone1/unit_tests/add_csv.js
Milestone1/unit_tests/add_csv.js
+7
-5
Milestone1/unit_tests/monitor.js
Milestone1/unit_tests/monitor.js
+30
-28
Milestone1/unit_tests/monitor.py
Milestone1/unit_tests/monitor.py
+38
-0
No files found.
Milestone1/results/add_csv.csv
View file @
bc230614
items,timestamp
items,timestamp
1000,158
1432948010
1000,158
2278164094
2000,158
143294816
4
2000,158
227816422
4
3000,158
1432948289
3000,158
2278164332
4000,158
143294840
1
4000,158
227816444
1
5000,158
1432948521
5000,158
2278164544
6000,158
1432948642
6000,158
2278164648
7000,158
1432948772
7000,158
2278164751
8000,158
1432948884
8000,158
2278164845
9000,158
1432948988
9000,158
2278164937
10000,158
1432949099
10000,158
2278165038
11000,158
1432949204
11000,158
2278165141
12000,158
1432949308
12000,158
2278165261
13000,158
1432949447
13000,158
2278165354
14000,158
1432949571
14000,158
2278165462
15000,158
1432949684
15000,158
2278165562
16000,158
1432949795
16000,158
2278165662
17000,158
1432949896
17000,158
2278165760
18000,158
1432950016
18000,158
2278165858
19000,158
1432950129
19000,158
2278165956
20000,158
1432950248
20000,158
2278166054
21000,158
1432950365
21000,158
2278166156
22000,158
143295049
0
22000,158
227816628
0
23000,158
1432950599
23000,158
2278166372
24000,158
1432950725
24000,158
2278166494
25000,158
1432950830
25000,158
2278166585
26000,158
1432950947
26000,158
2278166704
27000,158
1432951064
27000,158
2278166802
28000,158
1432951180
28000,158
2278166897
29000,158
143295130
0
29000,158
227816699
0
30000,158
1432951417
30000,158
2278167104
31000,158
1432951534
31000,158
2278167202
32000,158
1432951642
32000,158
2278167298
33000,158
1432951756
33000,158
2278167403
34000,158
1432951876
34000,158
2278167499
35000,158
1432951982
35000,158
2278167591
36000,158
1432952099
36000,158
2278167691
37000,158
1432952213
37000,158
2278167801
38000,158
1432952331
38000,158
2278167907
39000,158
1432952461
39000,158
2278168034
40000,158
1432952565
40000,158
2278168133
41000,158
1432952691
41000,158
2278168228
42000,158
1432952830
42000,158
2278168345
43000,158
1432952940
43000,158
2278168447
44000,158
1432953056
44000,158
2278168567
45000,158
1432953165
45000,158
2278168702
46000,158
1432953284
46000,158
2278168828
47000,158
1432953402
47000,158
2278168929
48000,158
1432953520
48000,158
2278169028
49000,158
1432953629
49000,158
2278169128
50000,158
1432953755
50000,158
2278169236
51000,158
143295386
7
51000,158
227816935
7
52000,158
1432953980
52000,158
2278169456
53000,158
1432954098
53000,158
2278169552
54000,158
1432954217
54000,158
2278169649
55000,158
143295433
5
55000,158
227816974
5
56000,158
1432954443
56000,158
2278169839
57000,158
1432954557
57000,158
2278169940
58000,158
1432954670
58000,158
2278170041
59000,158
1432954784
59000,158
2278170137
60000,158
1432954899
60000,158
2278170254
61000,158
1432955017
61000,158
2278170350
62000,158
1432955131
62000,158
2278170448
63000,158
1432955251
63000,158
2278170544
64000,158
1432955367
64000,158
2278170640
65000,158
1432955484
65000,158
2278170738
66000,158
1432955603
66000,158
2278170850
67000,158
1432955712
67000,158
2278170956
68000,158
1432955903
68000,158
2278171127
69000,158
1432956015
69000,158
2278171240
70000,158
1432956119
70000,158
2278171345
71000,158
1432956225
71000,158
2278171480
72000,158
1432956331
72000,158
2278171582
73000,158
1432956450
73000,158
2278171728
74000,158
1432956562
74000,158
2278171827
75000,158
1432956667
75000,158
2278171923
76000,158
1432956783
76000,158
2278172021
77000,158
1432956895
77000,158
2278172129
78000,158
1432957001
78000,158
2278172264
79000,158
1432957114
79000,158
2278172362
80000,158
1432957239
80000,158
2278172480
81000,158
1432957348
81000,158
2278172605
82000,158
143295746
8
82000,158
227817273
8
83000,158
1432957578
83000,158
2278172854
84000,158
1432957679
84000,158
2278172956
85000,158
1432957802
85000,158
2278173057
86000,158
1432957918
86000,158
2278173153
87000,158
1432958039
87000,158
2278173251
88000,158
1432958154
88000,158
2278173360
89000,158
1432958258
89000,158
2278173455
90000,158
1432958372
90000,158
2278173555
91000,158
1432958484
91000,158
2278173667
92000,158
1432958589
92000,158
2278173765
93000,158
1432958704
93000,158
2278173857
94000,158
1432958809
94000,158
2278173958
95000,158
1432958912
95000,158
2278174055
96000,158
1432959030
96000,158
2278174154
97000,158
1432959150
97000,158
2278174258
98000,158
1432959267
98000,158
2278174359
99000,158
1432959384
99000,158
2278174456
100000,158
1432959500
100000,158
2278174554
101000,158
1432959617
101000,158
2278174664
102000,158
1432959741
102000,158
2278174759
103000,158
1432959847
103000,158
2278174858
104000,158
1432959969
104000,158
2278174955
105000,158
1432960085
105000,158
2278175060
106000,158
143296019
8
106000,158
227817515
8
107000,158
1432960315
107000,158
2278175256
108000,158
1432960432
108000,158
2278175356
109000,158
1432960550
109000,158
2278175456
110000,158
1432960676
110000,158
2278175558
111000,158
1432960786
111000,158
2278175661
112000,158
1432961016
112000,158
2278175847
113000,158
1432961136
113000,158
2278176031
114000,158
1432961251
114000,158
2278176126
115000,158
1432961362
115000,158
2278176223
116000,158
1432961487
116000,158
2278176334
117000,158
1432961594
117000,158
2278176450
118000,158
1432961707
118000,158
2278176551
119000,158
1432961815
119000,158
2278176654
120000,158
1432961937
120000,158
2278176752
121000,158
1432962051
121000,158
2278176850
122000,158
1432962186
122000,158
2278176965
123000,158
1432962303
123000,158
2278177064
124000,158
1432962421
124000,158
2278177210
125000,158
1432962528
125000,158
2278177303
126000,158
1432962648
126000,158
2278177406
127000,158
1432962769
127000,158
2278177508
128000,158
1432962884
128000,158
2278177619
129000,158
1432963003
129000,158
2278177719
130000,158
1432963113
130000,158
2278177818
131000,158
1432963218
131000,158
2278177917
132000,158
1432963332
132000,158
2278178020
133000,158
1432963456
133000,158
2278178163
134000,158
1432963569
134000,158
2278178257
135000,158
143296367
7
135000,158
227817836
7
136000,158
1432963786
136000,158
2278178465
137000,158
1432963897
137000,158
2278178569
138000,158
143296401
6
138000,158
227817866
6
139000,158
14329641
61
139000,158
22781787
61
140000,158
1432964266
140000,158
2278178857
141000,158
1432964381
141000,158
2278178965
142000,158
1432964500
142000,158
2278179063
143000,158
1432964616
143000,158
2278179158
144000,158
1432964734
144000,158
2278179270
145000,158
1432964856
145000,158
2278179370
146000,158
1432964967
146000,158
2278179466
147000,158
1432965072
147000,158
2278179563
148000,158
1432965182
148000,158
2278179657
149000,158
1432965298
149000,158
2278179766
150000,158
1432965423
150000,158
2278179864
151000,158
1432965543
151000,158
2278179975
152000,158
1432965652
152000,158
2278180074
153000,158
1432965774
153000,158
2278180175
154000,158
1432965878
154000,158
2278180272
155000,158
1432966001
155000,158
2278180385
156000,158
1432966120
156000,158
2278180484
157000,158
1432966242
157000,158
2278180583
158000,158
1432966355
158000,158
2278180680
159000,158
1432966462
159000,158
2278180790
160000,158
1432966582
160000,158
2278180889
161000,158
1432966698
161000,158
2278180990
162000,158
1432966819
162000,158
2278181090
163000,158
143296694
2
163000,158
227818119
2
164000,158
1432967046
164000,158
2278181289
165000,158
1432967169
165000,158
2278181396
166000,158
1432967293
166000,158
2278181490
167000,158
1432967401
167000,158
2278181590
168000,158
143296751
9
168000,158
227818168
9
169000,158
1432967651
169000,158
2278181790
170000,158
1432967785
170000,158
2278181907
171000,158
1432967892
171000,158
2278182007
172000,158
1432967998
172000,158
2278182116
173000,158
14329681
17
173000,158
22781822
17
174000,158
1432968235
174000,158
2278182314
175000,158
1432968378
175000,158
2278182440
176000,158
1432968690
176000,158
2278182685
177000,158
1432968815
177000,158
2278182810
178000,158
1432968932
178000,158
2278182903
179000,158
1432969051
179000,158
2278183013
180000,158
1432969168
180000,158
2278183113
181000,158
1432969279
181000,158
2278183222
182000,158
1432969387
182000,158
2278183336
183000,158
1432969499
183000,158
2278183437
184000,158
1432969621
184000,158
2278183537
185000,158
1432969733
185000,158
2278183636
186000,158
1432969854
186000,158
2278183735
187000,158
1432969965
187000,158
2278183832
188000,158
1432970091
188000,158
2278183926
189000,158
1432970198
189000,158
2278184025
190000,158
1432970319
190000,158
2278184122
191000,158
1432970435
191000,158
2278184226
192000,158
1432970551
192000,158
2278184322
193000,158
1432970667
193000,158
2278184421
194000,158
1432970784
194000,158
2278184532
195000,158
1432970898
195000,158
2278184625
196000,158
1432971016
196000,158
2278184723
197000,158
1432971141
197000,158
2278184837
198000,158
1432971249
198000,158
2278184934
199000,158
1432971367
199000,158
2278185035
200000,158
1432971491
200000,158
2278185133
201000,158
1432971597
201000,158
2278185231
202000,158
1432971719
202000,158
2278185326
203000,158
1432971862
203000,158
2278185426
204000,158
1432971972
204000,158
2278185521
205000,158
1432972088
205000,158
2278185634
206000,158
1432972192
206000,158
2278185731
207000,158
1432972300
207000,158
2278185825
208000,158
1432972416
208000,158
2278185921
209000,158
1432972541
209000,158
2278186022
210000,158
1432972652
210000,158
2278186120
211000,158
1432972766
211000,158
2278186235
212000,158
1432972883
212000,158
2278186348
213000,158
1432972993
213000,158
2278186444
214000,158
1432973105
214000,158
2278186548
215000,158
1432973209
215000,158
2278186643
216000,158
1432973324
216000,158
2278186740
217000,158
1432973433
217000,158
2278186838
218000,158
14329735
48
218000,158
22781869
48
219000,158
143297366
6
219000,158
227818705
6
220000,158
143297378
4
220000,158
227818716
4
221000,158
1432973895
221000,158
2278187259
222000,158
1432974033
222000,158
2278187358
223000,158
1432974139
223000,158
2278187456
224000,158
1432974248
224000,158
2278187567
225000,158
1432974368
225000,158
2278187682
226000,158
1432974491
226000,158
2278187779
227000,158
1432974597
227000,158
2278187875
228000,158
1432974718
228000,158
2278187974
229000,158
1432974831
229000,158
2278188075
230000,158
1432974957
230000,158
2278188174
231000,158
1432975069
231000,158
2278188275
232000,158
1432975186
232000,158
2278188375
233000,158
1432975302
233000,158
2278188473
234000,158
143297541
7
234000,158
227818857
7
235000,158
1432975533
235000,158
2278188675
236000,158
1432975650
236000,158
2278188773
237000,158
1432975768
237000,158
2278188875
238000,158
1432975876
238000,158
2278188971
239000,158
1432975983
239000,158
2278189098
240000,158
1432976102
240000,158
2278189193
241000,158
1432976222
241000,158
2278189291
242000,158
1432976333
242000,158
2278189389
243000,158
1432976440
243000,158
2278189489
244000,158
1432976548
244000,158
2278189589
245000,158
1432976674
245000,158
2278189691
246000,158
143297678
9
246000,158
227818979
9
247000,158
1432976
899
247000,158
2278189
899
248000,158
1432977001
248000,158
2278189993
249000,158
1432977119
249000,158
2278190090
250000,158
1432977222
250000,158
2278190190
251000,158
1432977334
251000,158
2278190290
252000,158
1432977448
252000,158
2278190390
253000,158
1432977563
253000,158
2278190492
254000,158
1432977681
254000,158
2278190590
255000,158
1432977808
255000,158
2278190697
256000,158
1432977926
256000,158
2278190794
Milestone1/results/add_csv_monitor.csv
View file @
bc230614
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Milestone1/results/test.csv
deleted
100644 → 0
View file @
a707b8ca
items,ramUsed,memUsed
1000,0.1296115260144386,5.12109375
2000,0.1690131572551702,7.19921875
3000,0.1530372945722992,7.69921875
4000,0.1568615260144386,15.44921875
5000,0.13156515504669675,9.7265625
6000,-0.1358904734856864,12.16015625
7000,-0.10511908929321523,12.6328125
8000,0.13174770641252376,1.88671875
9000,0.024319474027435395,2.359375
10000,-0.14388847398556137,4.86328125
11000,-0.14388847398556137,5.19140625
12000,-0.11240421611449691,25.125
13000,-0.14388847398556137,8.59375
14000,-0.13589247198656085,30.96875
15000,-0.14012435855268812,32.8828125
16000,-0.10031164778908785,14.68359375
17000,-0.1358904734856864,14.45703125
18000,-0.14388847398556137,17.10546875
19000,-0.13987341752382987,23.25
20000,-0.13992022001730742,19.984375
21000,-0.1283845980165691,20.68359375
22000,-0.1360740046132397,23.18359375
23000,-0.14388847398556137,35.23828125
24000,0.4067745232623746,38.765625
25000,-0.13589247198656085,41.1875
26000,-0.11687496723218471,29.30078125
27000,-0.14388847398556137,47.12890625
28000,-0.1083973467673659,50.73828125
29000,-0.13988847398556137,32.81640625
30000,-0.13188847398556136,35.2421875
31000,-0.14388847398556137,35.77734375
32000,-0.12072533575392996,40.8125
33000,-0.14388847398556137,38.6015625
34000,-0.13641463243100238,41.10546875
35000,-0.12789646998756032,41.9921875
36000,-0.13993590481560092,44.48046875
37000,-0.13985621592104525,44.88671875
38000,-0.13988847398556137,47.390625
39000,-0.13610734948756942,50.19140625
40000,-0.14388847398556137,52.73828125
41000,-0.14388847398556137,53.13671875
42000,-0.14388847398556137,76.7109375
43000,-0.12398421598606524,56.046875
44000,-0.13988847398556137,58.65234375
45000,-0.14388847398556137,59.11328125
46000,-0.12874824067704804,61.578125
47000,-0.14388847398556137,61.9453125
48000,-0.14388847398556137,64.4296875
49000,-0.12398421598606524,64.80078125
50000,-0.14388847398556137,65.515625
51000,-0.13988847398556137,67.73828125
52000,-0.13582598973260096,68.55078125
53000,-0.13189447098706064,71.22265625
54000,-0.14013847398556134,71.97265625
55000,-0.1401375362511278,74.37109375
56000,-0.13988947373562388,75.12109375
57000,-0.12389347273587381,77.25
58000,-0.14388847398556137,78.203125
59000,-0.14388847398556137,80.20703125
60000,-0.13586037564135667,81.671875
61000,-0.13988947373562388,83.16015625
62000,-0.11276297597759322,85.16015625
63000,-0.13613653600106523,86.25390625
64000,-0.13988947373562388,86.79296875
65000,-0.1358904734856864,89.23046875
66000,-0.07037738502468427,89.8046875
67000,-0.09356460751819717,92.29296875
68000,-0.13189447098706064,93.34375
69000,-0.09739400904091189,95.765625
70000,-0.14388847398556137,98.18359375
71000,-0.14388847398556137,99.09765625
72000,-0.13213847398556133,99.515625
73000,-0.1323827211091232,102.07421875
74000,-0.13988847398556137,102.51953125
75000,-0.13209424562922512,104.9453125
76000,-0.13607794236550597,105.47265625
77000,-0.13988847398556137,107.9921875
78000,-0.13592034649552154,108.4453125
79000,-0.14388847398556137,110.9453125
80000,-0.14388847398556137,111.51953125
81000,-0.1213173258010668,114.53125
82000,-0.08535920935324526,119.125
83000,-0.12454323589032323,117.4296875
84000,-0.04616290537771328,126.203125
85000,-0.14388847398556137,120.46484375
86000,-0.06986996935940482,127.68359375
87000,-0.14388847398556137,123.48828125
88000,-0.11618066542132965,133.29296875
89000,-0.13214141075136987,126.46484375
90000,-0.09275497272611555,140.37109375
91000,-0.13988847398556137,129.609375
92000,-0.09695072298154528,146.25
93000,-0.1401375362511278,133.18359375
94000,-0.06502729988629208,143.36328125
95000,-0.13238559826663165,128.60546875
96000,-0.0538659683591548,138.01953125
97000,-0.13214141075136987,131.44921875
98000,-0.1401375362511278,154.03125
99000,-0.1361053959037135,134.48828125
100000,-0.1282012229895454,134.95703125
101000,-0.12446132579128988,137.3828125
102000,-0.13641463243100238,137.9140625
103000,-0.13613847398556134,161.6875
104000,-0.1321355357510028,160.46875
105000,-0.13613847398556134,143.98046875
106000,-0.13613847398556134,144.52734375
107000,-0.14388847398556137,146.88671875
108000,-0.12421715924452548,150.640625
109000,-0.14388847398556137,155.12109375
110000,-0.09293465872451723,165.87109375
111000,-0.14388847398556137,158.32421875
112000,-0.08138847398556137,163.21875
113000,-0.12414834405052888,162.3671875
114000,-0.06959128523054126,167.07421875
115000,-0.14388847398556137,165.30078125
116000,-0.13614041100130747,182.70703125
117000,-0.14388847398556137,168.34375
118000,-0.13218237186850035,168.77734375
119000,-0.14388847398556137,171.35546875
120000,-0.06986996935940482,178.375
121000,-0.12439334776711597,192.6484375
122000,-0.12813847398556133,195.9921875
123000,-0.14388847398556137,177.83984375
124000,-0.13988947373562388,178.23828125
125000,-0.0897941811815911,201.44921875
126000,-0.14388847398556137,181.03515625
127000,-0.1358904734856864,183.5390625
128000,-0.1130090273452452,197.55859375
129000,-0.13988947373562388,186.63671875
130000,-0.13613653600106523,187.33984375
131000,-0.11663847398556138,202.4375
132000,-0.1363865985166941,190.546875
133000,-0.1363865985166941,193.1875
134000,-0.10479484848755338,193.6875
135000,-0.13988847398556137,196.19921875
136000,-0.12844638183114043,196.625
137000,-0.13607597398556137,199.203125
138000,-0.13588847398556136,199.64453125
139000,-0.13988947373562388,220.984375
140000,-0.11670784636015985,203.09765625
141000,-0.1401375362511278,205.71484375
142000,-0.11239439487243463,205.97265625
143000,-0.1005833470567411,214.73828125
144000,-0.13218237186850035,209.21875
145000,-0.14388847398556137,211.703125
146000,-0.13613847398556134,212.21484375
147000,-0.13613847398556134,215.234375
148000,-0.13586037564135667,215.63671875
149000,-0.14388847398556137,218.3203125
150000,-0.13582598973260096,218.82421875
151000,-0.14388847398556137,221.07421875
152000,-0.13592233009708743,217.7265625
153000,-0.14388847398556137,241.40234375
154000,-0.1398724097285332,220.7890625
155000,-0.14388847398556137,223.71484375
156000,-0.08515315781460409,232.1796875
157000,-0.1401082320500775,226.8046875
158000,-0.05036509314035009,230.4375
159000,-0.1358904734856864,229.8125
160000,-0.10072661702194785,240.390625
161000,-0.13184632646925432,254.1796875
162000,-0.13613653600106523,233.92578125
163000,-0.1401375362511278,236.30078125
164000,-0.14388847398556137,236.89453125
165000,-0.13218820014936516,239.2578125
166000,-0.13616935047958523,239.86328125
167000,-0.14388847398556137,257.89453125
168000,-0.14388847398556137,242.93359375
169000,-0.12863466053219808,245.3515625
170000,-0.1321355357510028,265.66796875
171000,-0.13610734948756942,249.0234375
172000,-0.13613653600106523,249.43359375
173000,-0.14388847398556137,251.83203125
174000,-0.07763847398556134,260.19140625
175000,-0.12438847398556141,254.87890625
176000,-0.13238559826663165,276.62109375
177000,-0.13614041100130747,258.58984375
178000,-0.1361961662932537,258.96484375
179000,-0.12438359776650665,261.34375
180000,-0.11664528478286207,282.90625
181000,-0.12813847398556133,264.48828125
182000,-0.14388847398556137,265.14453125
183000,-0.1401082320500775,267.5234375
184000,-0.13238559826663165,289.63671875
185000,-0.14388847398556137,270.98828125
186000,-0.09336321135424575,276.125
187000,-0.12789646998756032,274.109375
188000,-0.09713847398556141,282.890625
189000,-0.12813453550094023,299.31640625
190000,-0.09688847398556133,294.0078125
191000,-0.14388847398556137,281.4296875
192000,-0.11639534726724099,298.98046875
193000,-0.1321852867345653,284.96875
194000,-0.07686907363282769,294.05859375
195000,-0.14388847398556137,288.05859375
196000,0.036332409548575195,306.92578125
197000,-0.13242858360190413,291.3359375
198000,-0.08516783430540142,319.05078125
199000,-0.14388847398556137,295.60546875
200000,0.020570411293118984,317.1484375
201000,-0.14388847398556137,299.01953125
202000,-0.12423121592104525,317.1875
203000,-0.13613847398556134,323.421875
204000,-0.0891384739855614,305.05078125
205000,-0.13613847398556134,327.22265625
206000,-0.11190660543859587,306.375
207000,-0.12825571964312965,308.7578125
208000,-0.10887972179751437,309.94140625
209000,-0.13988947373562388,328.1171875
210000,-0.1163884739855614,325.6796875
211000,-0.13214141075136987,329.4921875
212000,-0.10873026203176928,336.23828125
213000,-0.14388847398556137,318.30859375
214000,-0.1280791891674936,334.7890625
215000,-0.13607597398556137,321.21484375
216000,-0.10887972179751437,356.40625
Milestone1/run.js
View file @
bc230614
...
@@ -19,6 +19,7 @@ const args = require("yargs")
...
@@ -19,6 +19,7 @@ const args = require("yargs")
.
nargs
(
"
verbose
"
,
0
)
.
nargs
(
"
verbose
"
,
0
)
.
argv
;
.
argv
;
var
run
;
var
run
;
var
to_run
=
[];
var
to_run
=
[];
var
options
=
[];
var
options
=
[];
...
@@ -82,6 +83,7 @@ run = function (callback) {
...
@@ -82,6 +83,7 @@ run = function (callback) {
};
};
fs
.
readFile
(
"
./config.json
"
,
"
utf8
"
,
function
(
err
,
data
)
{
fs
.
readFile
(
"
./config.json
"
,
"
utf8
"
,
function
(
err
,
data
)
{
if
(
err
)
{
if
(
err
)
{
return
console
.
log
(
"
Error while reading config file :
"
+
err
);
return
console
.
log
(
"
Error while reading config file :
"
+
err
);
}
}
...
...
Milestone1/unit_tests/add_csv.js
View file @
bc230614
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
var
childProcess
=
require
(
"
child_process
"
);
var
childProcess
=
require
(
"
child_process
"
);
var
cut_file
=
require
(
"
./random_gen
"
).
cut_file
;
var
cut_file
=
require
(
"
./random_gen
"
).
cut_file
;
var
diskspace
=
require
(
"
diskspace
"
);
//
var diskspace = require("diskspace");
// var os_utils = require("os-utils");
// var os_utils = require("os-utils");
var
os
=
require
(
'
os
'
);
//
var os = require('os');
const
puppeteer
=
require
(
"
puppeteer
"
);
const
puppeteer
=
require
(
"
puppeteer
"
);
const
Server
=
require
(
"
ws
"
).
Server
;
const
Server
=
require
(
"
ws
"
).
Server
;
const
args
=
require
(
"
yargs
"
)
const
args
=
require
(
"
yargs
"
)
...
@@ -28,8 +28,9 @@ var page;
...
@@ -28,8 +28,9 @@ var page;
var
n
=
0
;
var
n
=
0
;
var
time
;
var
time
;
var
monitor
;
var
monitor
;
var
ramBefore
;
// var ramBefore;
var
memBefore
;
// var memBefore;
var
browser_pid
;
function
init_server
(){
function
init_server
(){
var
port
=
9030
;
var
port
=
9030
;
...
@@ -92,10 +93,11 @@ async function query (){
...
@@ -92,10 +93,11 @@ async function query (){
files
=
cut_file
(
args
.
file
,
1000
);
files
=
cut_file
(
args
.
file
,
1000
);
init_server
();
init_server
();
browser
=
await
puppeteer
.
launch
();
browser
=
await
puppeteer
.
launch
();
browser_pid
=
browser
.
process
().
pid
;
page
=
await
browser
.
newPage
();
page
=
await
browser
.
newPage
();
await
page
.
goto
(
link
);
await
page
.
goto
(
link
);
monitor
=
childProcess
.
fork
(
"
./unit_tests/monitor.js
"
,
monitor
=
childProcess
.
fork
(
"
./unit_tests/monitor.js
"
,
args
.
r
?
[
"
-r
"
]
:
[
]);
args
.
r
?
[
"
-r
"
,
"
-p
"
,
browser_pid
]
:
[
"
-p
"
,
browser_pid
]);
timeout
();
timeout
();
query
();
query
();
// diskspace.check("C", function (err, result){
// diskspace.check("C", function (err, result){
...
...
Milestone1/unit_tests/monitor.js
View file @
bc230614
var
os
=
require
(
'
os
'
);
const
fs
=
require
(
"
fs
"
);
const
fs
=
require
(
"
fs
"
);
var
diskspace
=
require
(
"
diskspace
"
);
var
diskspace
=
require
(
"
diskspace
"
);
const
args
=
require
(
"
yargs
"
).
argv
;
const
args
=
require
(
"
yargs
"
).
argv
;
var
childProcess
=
require
(
"
child_process
"
);
var
pid
=
args
.
p
;
var
path
=
args
.
r
var
path
=
args
.
r
?
"
./results/add_random_csv_monitor.csv
"
?
"
./results/add_random_csv_monitor.csv
"
:
"
./results/add_csv_monitor.csv
"
;
:
"
./results/add_csv_monitor.csv
"
;
...
@@ -10,35 +11,36 @@ var stream = fs.createWriteStream(path, {flags: "w+"});
...
@@ -10,35 +11,36 @@ var stream = fs.createWriteStream(path, {flags: "w+"});
stream
.
write
(
"
time,ram,disk
\n
"
);
stream
.
write
(
"
time,ram,disk
\n
"
);
var
start_disk
;
var
start_disk
;
var
start_ram
=
os
.
totalmem
()
-
os
.
freemem
();
function
init_monitor
(){
// function init_server (){
var
net
=
require
(
'
net
'
);
// var port = 9030;
const
port
=
9040
;
// var ws = new Server({port: port});
// ws.on("connection", function(w){
var
server
=
net
.
createServer
(
function
(
socket
)
{
// w.on("message", function(){
socket
.
on
(
"
data
"
,
function
(
data
){
// process.send(max_ram);
// });
// w.on("close", function() {
// ws.close();
// });
// });
// }
var
check
=
function
(){
setTimeout
(
function
()
{
diskspace
.
check
(
"
/
"
,
function
(
err
,
result
){
diskspace
.
check
(
"
/
"
,
function
(
err
,
result
){
//var disk_used = parseInt(result.used) - parseInt(start_disk);
var
disk_used
=
result
.
used
-
start_disk
;
var
disk_used
=
result
.
used
-
start_disk
;
var
ram_used
=
os
.
totalmem
()
-
os
.
freemem
()
;
var
ram_used
=
data
;
stream
.
write
(
Date
.
now
()
+
"
,
"
+
ram_used
+
"
,
"
+
disk_used
+
"
\n
"
);
stream
.
write
(
Date
.
now
()
+
"
,
"
+
ram_used
+
"
,
"
+
disk_used
+
"
\n
"
);
check
();
});
});
},
1
);
})
socket
.
on
(
"
error
"
,
function
(
err
){
console
.
log
(
"
Error :
"
+
err
.
message
);
})
});
server
.
listen
(
port
,
function
()
{});
var
monitor
=
childProcess
.
spawn
(
'
python
'
,
[
"
./unit_tests/monitor.py
"
,
"
--p
"
,
pid
],
{
stdio
:
'
inherit
'
});
}
}
//init_server();
process
.
on
(
"
exit
"
,
function
(){
monitor
.
kill
();
})
diskspace
.
check
(
"
C
"
,
function
(
err
,
result
){
diskspace
.
check
(
"
C
"
,
function
(
err
,
result
){
start_disk
=
result
.
used
;
start_disk
=
result
.
used
;
check
();
init_monitor
();
});
});
Milestone1/unit_tests/monitor.py
0 → 100644
View file @
bc230614
import
psutil
import
os
import
subprocess
import
time
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
''
)
parser
.
add_argument
(
"--p"
,
type
=
int
,
help
=
"pid"
)
args
=
parser
.
parse_args
()
import
socket
client
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
client
.
connect
((
'localhost'
,
9040
))
class
_Snapshot
(
object
):
def
get
(
self
,
property
,
default
=
None
):
return
getattr
(
self
,
property
,
default
)
class
ProcessSnapshot
(
_Snapshot
):
def
__init__
(
self
,
process
=
None
):
assert
type
(
process
)
is
psutil
.
Process
self
.
username
=
process
.
username
()
self
.
process_object
=
process
self
.
pid
=
process
.
pid
# Memory percentage
self
.
memory_percent
=
process
.
memory_percent
()
def
update_memory_percent
(
self
):
if
self
.
process_object
.
is_running
():
self
.
memory_percent
=
self
.
process_object
.
memory_percent
()
process
=
psutil
.
Process
(
args
.
p
)
snapshot
=
ProcessSnapshot
(
process
)
while
(
1
)
:
snapshot
.
update_memory_percent
()
client
.
send
(
str
(
snapshot
.
memory_percent
))
time
.
sleep
(
0.1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment