Commits

Anonymous committed 73e65c9

Some UI improvements.

  • Participants
  • Parent commits 0cfaa77

Comments (0)

Files changed (2)

pyramid_perfstat/templates/reporting.mako

 <%def name="get_label_perf(avg_time)">
 	% if avg_time > 1 :
-		<font class="bad_perf">BAD</font>
+		<span class="bad_perf">BAD</span>
 	% elif avg_time > 0.6 :
-		<font class="poor_perf">POOR</font>
+		<span class="poor_perf">POOR</span>
 	% elif avg_time > 0.3 :
-		<font class="small_perf">SMALL</font>
-	% else :	
-		<font class="good_perf">GOOD</font>
+		<span class="small_perf">SMALL</span>
+	% else :
+		<span class="good_perf">GOOD</span>
 	% endif
 </%def>
 
 <%def name="get_color_perf(avg_time)">
 	% if avg_time > 1 :
-		<font class="bad_perf">${"%1.3f"%avg_time} s</font>
+		<span class="bad_perf">${"%d"%(int(avg_time*1000.0))}</span>
 	% elif avg_time > 0.6 :
-		<font class="poor_perf">${"%d"%(int(avg_time*1000.0))} ms</font>
+		<span class="poor_perf">${"%d"%(int(avg_time*1000.0))}</span>
 	% elif avg_time > 0.3 :
-		<font class="small_perf">${"%d"%(int(avg_time*1000.0))} ms</font>
-	% else :	
-		<font class="good_perf">${"%d"%(int(avg_time*1000.0))} ms</font>
+		<span class="small_perf">${"%d"%(int(avg_time*1000.0))}</span>
+	% else :
+		<span class="good_perf">${"%d"%(int(avg_time*1000.0))}</span>
 	% endif
 </%def>
 
 		<td>${get_label_perf(avg_time)}</td>
 		<td>${url}</td>
 		<td>
-                  <a href="${request.route_url("pyramid_perfstat.reporting.url_detail", id_session=id_session, id_view=id_view, id_route=id)}">${route_name}</a>
-                </td>
+				  <a href="${request.route_url("pyramid_perfstat.reporting.url_detail", id_session=id_session, id_view=id_view, id_route=id)}">${route_name}</a>
+				</td>
 		<td>${view_name}</td>
 		<td>${cpt}</td>
 	</tr>
 		<title>Perf manager</title>
 		
 		<style type="text/css">
+<!--
+.bad_perf {
+	color:#A42020;
+	font-weight: bold;
+}
+.poor_perf {
+	color:#D78244;
+	font-weight: bold;
+}
+.small_perf {
+	color:#C4C200;
+	font-weight: bold;
+}
+.good_perf {
+	color:#4B855A;
+	font-weight: bold;
+}
 
-			.bad_perf { color:#A42020;
-						font-weight: bold;
-					  }
-			.poor_perf { color:#D78244;
-						 font-weight: bold;
-					   }
-			.small_perf { color:#C4C200;
-						  font-weight: bold;
-						}
-			.good_perf { color:#4B855A;
-						 font-weight: bold;
-						}
-		
-			/* tables */
-			table.tablesorter {
-				font-family:arial;
-				background-color: #CDCDCD;
-				margin:10px 0pt 15px;
-				font-size: 8pt;
-				width: 100%;
-				text-align: left;
-			}
-			table.tablesorter thead tr th, table.tablesorter tfoot tr th {
-				background-color: #e6EEEE;
-				border: 1px solid #FFF;
-				font-size: 8pt;
-				padding: 4px;
-			}
-			table.tablesorter thead tr .header {
-				background-image: url(${static_path}images/bg.gif);
-				background-repeat: no-repeat;
-				background-position: center right;
-				cursor: pointer;
-			}
-			table.tablesorter tbody td {
-				color: #3D3D3D;
-				padding: 4px;
-				background-color: #FFF;
-				vertical-align: top;
-			}
-			table.tablesorter tbody tr.odd td {
-				background-color:#F0F0F6;
-			}
-			table.tablesorter thead tr .headerSortUp {
-				background-image: url(${static_path}images/asc.gif);
-			}
-			table.tablesorter thead tr .headerSortDown {
-				background-image: url(${static_path}images/desc.gif);
-			}
-			table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
-			background-color: #8dbdd8;
-			}		
+/* tables */
+table.tablesorter {
+	font-family:arial;
+	background-color: #CDCDCD;
+	margin:10px 0pt 15px;
+	font-size: 8pt;
+	width: 100%;
+	text-align: left;
+}
+table.tablesorter thead tr th, table.tablesorter tfoot tr th {
+	background-color: #e6EEEE;
+	border: 1px solid #FFF;
+	font-size: 8pt;
+	padding: 4px;
+}
+table.tablesorter thead tr .header {
+	background-image: url(${static_path}images/bg.gif);
+	background-repeat: no-repeat;
+	background-position: center right;
+	cursor: pointer;
+}
+table.tablesorter tbody td {
+	color: #3D3D3D;
+	padding: 4px;
+	background-color: #FFF;
+	vertical-align: top;
+}
+table.tablesorter tbody tr.odd td {
+	background-color:#F0F0F6;
+}
+table.tablesorter thead tr .headerSortUp {
+	background-image: url(${static_path}images/asc.gif);
+}
+table.tablesorter thead tr .headerSortDown {
+	background-image: url(${static_path}images/desc.gif);
+}
+table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
+background-color: #8dbdd8;
+}
+
+#perf_views_reporting_table  tbody td:nth-child(1),
+#perf_routes_reporting_table tbody td:nth-child(1),
+#perf_urls_reporting_table   tbody td:nth-child(1) {
+	width: 5%;
+}
+
+#perf_views_reporting_table  tbody td:nth-child(2),
+#perf_routes_reporting_table tbody td:nth-child(2),
+#perf_urls_reporting_table   tbody td:nth-child(2) {
+	text-align: right;
+	width: 5%;
+}
+
+#perf_views_reporting_table  tbody td:nth-child(3),
+#perf_routes_reporting_table tbody td:nth-child(3),
+#perf_urls_reporting_table   tbody td:nth-child(3) {
+	width: 5%;
+}
+
+#perf_views_reporting_table  tbody td:nth-child(5),
+#perf_routes_reporting_table tbody td:nth-child(7) {
+	width: 5%;
+}
+-->
 		</style>
 		
 	</head>
 			<thead>
 				<tr>
 					<th>id</th>
-					<th>mean time</th>
+					<th>average time (ms)</th>
 					<th>category</th>
 					<th>matched view name</th>
 					<th>view count</th>
 				% endfor
 			</tbody>
 		</table>
-        % if lst_agg_routes_measures is not None :
+		% if lst_agg_routes_measures is not None :
 		<table id="perf_routes_reporting_table" class="tablesorter">
 			<thead>
 				<tr>
 					<th>id</th>
-					<th>mean time</th>
+					<th>average time (ms)</th>
 					<th>category</th>
 					<th>requested url</th>
 					<th>matched route name</th>
 				% endfor
 			</tbody>
 		</table>
-        % endif
-        % if lst_urls_measures is not None :
+		% endif
+		% if lst_urls_measures is not None :
 		<table id="perf_urls_reporting_table" class="tablesorter">
 			<thead>
 				<tr>
 					<th>id</th>
-					<th>mean time</th>
+					<th>average time (ms)</th>
 					<th>category</th>
 					<th>requested url</th>
 				</tr>
 				% endfor
 			</tbody>
 		</table>
-        % endif
+		% endif
 	</body>
 
 	<script type="text/javascript" src="${static_path}js/jquery-1.6.4.min.js"></script>
 			window.location.assign(page);
 		}	
 		$(document).ready(function() { 
-		    $("#perf_views_reporting_table").tablesorter({}); 
-		    
-		    $("#perf_routes_reporting_table").tablesorter({});
-		    
-		    % if lst_urls_measures is not None :
-		    	$("#perf_urls_reporting_table").tablesorter({});
-		    % endif
+			$("#perf_views_reporting_table").tablesorter({}); 
+			
+			$("#perf_routes_reporting_table").tablesorter({});
+			
+			% if lst_urls_measures is not None :
+				$("#perf_urls_reporting_table").tablesorter({});
+			% endif
 		});
 	</script>
 	
 
 setup(name='pyramid_perfstat',
       license='BSD License',
-      version='0.0.5',
+      version='0.1.0',
       description='Pyramid PerfStat logs and reports statistics about time usage of a pyramid webapp.',
       long_description=long_description,
       author='Bard Stéphane',