2 new revisions:

Revision: 07919187aef3
Author:   Mikko Korpela <[email protected]>
Date:     Thu Nov  3 12:01:53 2011
Log: test memory: Add --reference option to make it possible to compare per...
http://code.google.com/p/robotframework/source/detail?r=07919187aef3

Revision: 4dac59090035
Author:   Mikko Korpela <[email protected]>
Date:     Thu Nov  3 13:34:49 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=4dac59090035

==============================================================================
Revision: 07919187aef3
Author:   Mikko Korpela <[email protected]>
Date:     Thu Nov  3 12:01:53 2011
Log: test memory: Add --reference option to make it possible to compare performance with the JSON model parser
http://code.google.com/p/robotframework/source/detail?r=07919187aef3

Modified:
 /proto/memory_test/calculate_rebot_model.py

=======================================
--- /proto/memory_test/calculate_rebot_model.py Thu Nov  3 08:09:00 2011
+++ /proto/memory_test/calculate_rebot_model.py Thu Nov  3 12:01:53 2011
@@ -14,6 +14,7 @@

 import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'src'))
+from robot.reporting.outputparser import OutputParser
 from robot.result.builders import ResultFromXML
 try:
     import psutil
@@ -24,8 +25,11 @@
     """
     raise

-def calculate_rebot_model(output_path):
-    xml = ResultFromXML(output_path)
+def calculate_rebot_model(args):
+    if args[0] == '--reference':
+        xml = OutputParser().parse(args[1])
+    else:
+        xml = ResultFromXML(args[0])
     p = psutil.Process(os.getpid())
print 'Process memory usage after xml parsing %f M' % (float(p.get_memory_info().rss) / (1024**2))
     print 'Most common types'
@@ -37,8 +41,10 @@
         print """
         Simple memory profiler for robot output xml parsing.
         Calculates memory usages after result model has been created.
+        --reference will calculate using list model implementation.
         usage:
         calculate_rebot_model.py [PATH_TO_OUTPUT_XML]
+        calculate_rebot_model.py --reference [PATH_TO_OUTPUT_XML]
         """
     else:
-        calculate_rebot_model(sys.argv[1])
+        calculate_rebot_model(sys.argv[1:])

==============================================================================
Revision: 4dac59090035
Author:   Mikko Korpela <[email protected]>
Date:     Thu Nov  3 13:34:49 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=4dac59090035


Reply via email to