ACKNOWLEDGEMENTS:
Original author of optimization script: BartJr (Click here)
Enhancement by: lignumaqua (Click here)
Source: https://discussions.flightaware.com/...justment/18376
PROCEDURE:
(1) Install Python:
sudo apt-get install python
(2) Create a new file optimize-gain-mut.py
sudo nano optimize-gain-mut.py
(3) Copy paste code below in the new blank file, save file (Ctrl+o) and close file (Ctrl+x)
(4) Make file executable
sudo chmod +x optimize-gain-mut.py
(5) Start test
sudo ./optimize-gain-mut.py
It is a very lengthy test. Be patient.
Results will be displayed after test is completed.
Code below to be copy-pasted in blank file "optimize-gain-mut.py".
It requires dump1090-mutability ver 1.15~dev installed on Pi
When the test is run, it will start giving output, one line at a time then pause, then next line then pause and so on.
It is a very lengthy test. Be patient.
Results will be displayed after test is completed.
test 1 of 5
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 49.6 messages= 2147 positions= 392 planes= 14
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 48.0 messages= 2071 positions= 346 planes= 13
....................
....................
....................
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 22.9 messages= 1116 positions= 182 planes= 9
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 20.7 messages= 705 positions= 91 planes= 8
test 2 of 5
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 49.6 messages= 1136 positions= 178 planes= 9
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 48.0 messages= 1267 positions= 239 planes= 12
......................
.......................
......................
===Totals===
Gain, Messages, Positions, Aircraft
49.6 23647 585 183
48.0 24298 594 175
44.5 24238 558 182
43.9 26731 613 189
43.4 26240 572 184
42.1 24494 663 183
40.2 25305 537 179
38.6 24298 602 177
37.2 25508 631 180
36.4 26784 615 170
33.8 27507 718 174
32.8 31027 767 181
29.7 28477 552 185
28.0 29911 656 188
25.4 31822 1187 188
22.9 31240 1035 186
20.7 33081 955 192
Original author of optimization script: BartJr (Click here)
Enhancement by: lignumaqua (Click here)
Source: https://discussions.flightaware.com/...justment/18376
PROCEDURE:
(1) Install Python:
sudo apt-get install python
(2) Create a new file optimize-gain-mut.py
sudo nano optimize-gain-mut.py
(3) Copy paste code below in the new blank file, save file (Ctrl+o) and close file (Ctrl+x)
(4) Make file executable
sudo chmod +x optimize-gain-mut.py
(5) Start test
sudo ./optimize-gain-mut.py
It is a very lengthy test. Be patient.
Results will be displayed after test is completed.
Code below to be copy-pasted in blank file "optimize-gain-mut.py".
It requires dump1090-mutability ver 1.15~dev installed on Pi
Code:
#!/usr/bin/python2 import time, socket, subprocess, fileinput, os measure_duration = 62 #seconds ntests = 5 gains = "20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6".split() #gains = "36.4 38.6 40.2 42.1 44.5 48.0 49.6".split() #gains = "22.9 25.4 28.0 29.7 32.8 33.8 36.4".split() gains.reverse() results = {} for i in range(ntests): print "test", i+1, "of", ntests for g in gains: if g not in results: results[g] = [0,0,{}] #msgs, positions, aircraft for line in fileinput.input('/etc/default/dump1090-mutability', inplace=1): if line.startswith('GAIN'): print 'GAIN='+g else: print line, os.system("sudo /etc/init.d/dump1090-mutability restart") time.sleep(2) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('localhost',30003)) t = time.time() d = '' while 1: d += s.recv(32) if time.time() - t > measure_duration: break s.close() messages = 0 positions = 0 planes = {} for l in d.split('\n'): a = l.split(',') messages += 1 if len(a) > 4: if a[1] == '3': positions += 1 planes[a[4]] = 1 print "gain=",g, "messages=", messages, "positions=", positions, "planes=", len(planes.keys()) results[g][0] += messages results[g][1] += positions for hex in planes.keys(): results[g][2][hex] = 1 print "\n===Totals===" print "Gain, Messages, Positions, Aircraft" for g in gains: (messages,positions,planes) = results[g] print g, messages, positions, len(planes.keys())
When the test is run, it will start giving output, one line at a time then pause, then next line then pause and so on.
It is a very lengthy test. Be patient.
Results will be displayed after test is completed.
test 1 of 5
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 49.6 messages= 2147 positions= 392 planes= 14
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 48.0 messages= 2071 positions= 346 planes= 13
....................
....................
....................
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 22.9 messages= 1116 positions= 182 planes= 9
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 20.7 messages= 705 positions= 91 planes= 8
test 2 of 5
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 49.6 messages= 1136 positions= 178 planes= 9
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 48.0 messages= 1267 positions= 239 planes= 12
......................
.......................
......................
===Totals===
Gain, Messages, Positions, Aircraft
49.6 23647 585 183
48.0 24298 594 175
44.5 24238 558 182
43.9 26731 613 189
43.4 26240 572 184
42.1 24494 663 183
40.2 25305 537 179
38.6 24298 602 177
37.2 25508 631 180
36.4 26784 615 170
33.8 27507 718 174
32.8 31027 767 181
29.7 28477 552 185
28.0 29911 656 188
25.4 31822 1187 188
22.9 31240 1035 186
20.7 33081 955 192
Comment