~chris-rogers/maus/1046_a

« back to all changes in this revision

Viewing changes to tests/integration/load_test.py

  • Committer: Chris Rogers
  • Date: 2014-05-28 18:10:58 UTC
  • mfrom: (663.45.1 maus_load_tests)
  • Revision ID: chris.rogers@stfc.ac.uk-20140528181058-37j0xbeb6vx38at1
Load test progress - load test against an arbitrary run

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
2
 
#
3
 
# MAUS is free software: you can redistribute it and/or modify
4
 
# it under the terms of the GNU General Public License as published by
5
 
# the Free Software Foundation, either version 3 of the License, or
6
 
# (at your option) any later version.
7
 
#
8
 
# MAUS 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 MAUS.  If not, see <http://www.gnu.org/licenses/>.
15
 
#
16
 
#!/usr/bin/env python
17
 
 
18
 
"""
19
 
Load test the execution runner
20
 
"""
21
 
 
22
 
#################################################################
23
 
###!!! YOU ARE NOT ALLOWED TO MODIFY THIS FILE DIRECTLY    !!!###
24
 
###!!! PLEASE MAKE A COPY OF THIS FILE WITH THE CP COMMAND !!!###
25
 
#################################################################
26
 
 
27
 
import sys
28
 
import math
29
 
import MAUS
30
 
 
31
 
from Go import Go
32
 
 
33
 
def run():
34
 
    """Run a load test
35
 
    """
36
 
    map_group = MAUS.MapPyGroup()
37
 
 
38
 
    big_number = 100
39
 
    if len(sys.argv) == 2:
40
 
        big_number = int(math.fabs(float(sys.argv[1])))
41
 
 
42
 
 
43
 
    if len(sys.argv) == 2 and float(sys.argv[1]) < 0:
44
 
        print 'Using only empty events'
45
 
        map_group.append(MAUS.MapPyDoNothing())
46
 
    else:
47
 
        print 'Using fake simulation data'
48
 
        map_group.append(MAUS.MapPyFakeTestSimulation())
49
 
        
50
 
    print("Testing with %d events..." % big_number)
51
 
 
52
 
 
53
 
    inputer = MAUS.InputPyEmptyDocument(big_number)
54
 
    # mapMapGroup
55
 
    reducer = MAUS.ReducePyDoNothing()
56
 
    outputer = MAUS.OutputPyDoNothing()
57
 
 
58
 
 
59
 
    Go(inputer, map_group, reducer, outputer)
60
 
 
61
 
 
62
 
if __name__ == '__main__':
63
 
    run()