Commits

Martin Geisler committed d050895

Sanitize filenames to make the TeX compatible, generate PDFs

  • Participants
  • Parent commits cb9b06b
  • Branches rhodecode

Comments (0)

Files changed (2)

multimechanize/graph.py

         color='blue', linestyle='-', linewidth=0.0, marker='o', 
         markeredgecolor='blue', markerfacecolor='blue', markersize=2.0)
     ax.plot([0.0,], [0.0,], linewidth=0.0, markersize=0.0)
-    savefig(dir + image_name) 
+    savefig(dir + image_name + '.png')
+    savefig(dir + image_name + '.pdf')
     
     
 
             prop=matplotlib.font_manager.FontProperties(size='xx-small')
             )
             
-    savefig(dir + image_name) 
+    savefig(dir + image_name + '.png')
+    savefig(dir + image_name + '.pdf')
     
     
     
         color='red', linestyle='-', linewidth=0.75, marker='o', 
         markeredgecolor='red', markerfacecolor='yellow', markersize=2.0)
     ax.plot([0.0,], [0.0,], linewidth=0.0, markersize=0.0)
-    savefig(dir + image_name) 
-    
+    savefig(dir + image_name + '.png')
+    savefig(dir + image_name + '.pdf')

multimechanize/results.py

 #  This file is part of Multi-Mechanize
 
 
+import re
 import time
 from collections import defaultdict
 import graph
 import reportwriterxml
 
 
+def sanitize(name):
+    return '-'.join(re.split(r'\W+', name))
 
 def output_results(results_dir, results_file, run_time, rampup, ts_interval, user_group_configs=None, xml_reports=False):
     results = Results(results_dir + results_file, run_time)
         t = (resp_stats.elapsed_time, resp_stats.trans_time)
         trans_timer_points.append(t)
         trans_timer_vals.append(resp_stats.trans_time)
-    graph.resp_graph_raw(trans_timer_points, 'All_Transactions_response_times.png', results_dir)
+    graph.resp_graph_raw(trans_timer_points, 'All_Transactions_response_times', results_dir)
     
     report.write_line('<h3>Transaction Response Summary (secs)</h3>')
     report.write_line('<table>')
             percentile_90_resptime_points[interval_start] = pct_90
 
     report.write_line('</table>') 
-    graph.resp_graph(avg_resptime_points, percentile_80_resptime_points, percentile_90_resptime_points, 'All_Transactions_response_times_intervals.png', results_dir)
+    graph.resp_graph(avg_resptime_points, percentile_80_resptime_points, percentile_90_resptime_points, 'All_Transactions_response_times_intervals', results_dir)
     
     
     report.write_line('<h3>Graphs</h3>')
                 custom_timer_vals.append(val)
             except KeyError:
                 pass
-        graph.resp_graph_raw(custom_timer_points, timer_name + '_response_times.png', results_dir)
+        graph.resp_graph_raw(custom_timer_points, sanitize(timer_name) + '_response_times', results_dir)
         
         report.write_line('<hr />')
         report.write_line('<h2>Custom Timer: %s</h2>' % timer_name)
                 percentile_80_resptime_points[interval_start] = pct_80
                 percentile_90_resptime_points[interval_start] = pct_90
         report.write_line('</table>') 
-        graph.resp_graph(avg_resptime_points, percentile_80_resptime_points, percentile_90_resptime_points, timer_name + '_response_times_intervals.png', results_dir)
+        graph.resp_graph(avg_resptime_points, percentile_80_resptime_points, percentile_90_resptime_points, sanitize(timer_name) + '_response_times_intervals', results_dir)
     
         
         report.write_line('<h3>Graphs</h3>')
         report.write_line('<h4>Response Time: %s sec time-series</h4>' % ts_interval)
-        report.write_line('<img src="%s_response_times_intervals.png"></img>' % timer_name)
+        report.write_line('<img src="%s_response_times_intervals.png"></img>' % sanitize(timer_name))
         report.write_line('<h4>Response Time: raw data (all points)</h4>')        
-        report.write_line('<img src="%s_response_times.png"></img>' % timer_name)
+        report.write_line('<img src="%s_response_times.png"></img>' % sanitize(timer_name))