Mercurial > repos > mvdbeek > test_memory_consumption
comparison consume_memory.xml @ 0:8475ffddee99 draft default tip
planemo upload for repository https://github.com/mvdbeek
| author | mvdbeek |
|---|---|
| date | Tue, 28 Nov 2017 04:38:28 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:8475ffddee99 |
|---|---|
| 1 <tool id="consume_memory" name="Consume memory" version="0.1.0" profile="17.01"> | |
| 2 <command detect_errors="exit_code"><![CDATA[ | |
| 3 python '$consume_mem_script' > output.txt | |
| 4 ]]></command> | |
| 5 <configfiles> | |
| 6 <configfile name="consume_mem_script"><![CDATA[ | |
| 7 import sys | |
| 8 import time | |
| 9 | |
| 10 | |
| 11 consume_mem = ' ' * ${consume_mem_mb} * 1024 * 1024 | |
| 12 time.sleep(int(${sleep_time})) | |
| 13 print(sys.getsizeof(consume_mem)) | |
| 14 ]]></configfile> | |
| 15 </configfiles> | |
| 16 <inputs> | |
| 17 <param name="consume_mem_mb" label="memory to consume (in MB)" type="integer" max="8000" value="5000"/> | |
| 18 <param name="sleep_time" label="Sleep this many seconds after reserving memory" type="integer" value="60"/> | |
| 19 </inputs> | |
| 20 <outputs> | |
| 21 <data name="output" format="txt" from_work_dir="output.txt"/> | |
| 22 </outputs> | |
| 23 <help><![CDATA[ | |
| 24 Consumes a user-specified amount of memory and then sleeps a user-defined amount of time. | |
| 25 ]]></help> | |
| 26 </tool> |
