[Erp5-report] r46030 seb - /erp5/trunk/utils/timing_log_parser/plot.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 6 18:50:04 CEST 2011


Author: seb
Date: Tue Sep  6 18:50:04 2011
New Revision: 46030

URL: http://svn.erp5.org?rev=46030&view=rev
Log:
add option to not build graph when there is not enough values

Modified:
    erp5/trunk/utils/timing_log_parser/plot.py

Modified: erp5/trunk/utils/timing_log_parser/plot.py
URL: http://svn.erp5.org/erp5/trunk/utils/timing_log_parser/plot.py?rev=46030&r1=46029&r2=46030&view=diff
==============================================================================
--- erp5/trunk/utils/timing_log_parser/plot.py [utf8] (original)
+++ erp5/trunk/utils/timing_log_parser/plot.py [utf8] Tue Sep  6 18:50:04 2011
@@ -114,6 +114,9 @@ def main():
     help="ignore IGNORED_QUANTITY higher values that might make a graph totally unusable")
   parser.add_option("--out-type", type="string", default="png",
     help="can be %default (default) or svg")
+  parser.add_option("--minimal-non-empty-values-ratio", type="float",
+    dest="minimal_non_empty_ratio", default=None,
+    help="graph with ratio of non empty values with lesser than value, then graph is ignored")
   (options, file_name_list) = parser.parse_args()
 
   current_dir = os.getcwd()
@@ -182,6 +185,12 @@ def main():
       if len(x_data) == 0:
         print 'Nothing to plot for %s...' % (out_file_name, )
         continue
+      if options.minimal_non_empty_ratio is not None:
+        column_len = len(column)
+        if column_len:
+          if float(len(x_data))/column_len < options.minimal_non_empty_ratio:
+            print 'Not enough values to plot for %s...' % (out_file_name, )
+            continue
       r_y_data = robjects.FloatVector(y_data)
       r_x_data = robjects.FloatVector(x_data)
       robjects.globalenv["y_data"] = r_y_data



More information about the Erp5-report mailing list