Remove the 'All Metrics' tab

This commit is contained in:
Gaël Métais
2014-10-27 18:07:30 +01:00
parent 13d4b075a8
commit d279959042
8 changed files with 15 additions and 85 deletions
@@ -21,10 +21,6 @@ var resultsController = function(req, res, googleAnalyticsId) {
fs.readFile('./app/node_views/results.html', {encoding: 'utf8'}, callback);
},
phantomasMetadata: function(callback) {
fs.readFile('./node_modules/phantomas/lib/metadata/metadata.json', {encoding: 'utf8'}, callback);
},
phantomasResults: function(callback) {
fs.readFile(phantomasResultsPath, {encoding: 'utf8'}, callback);
}
@@ -40,7 +36,6 @@ var resultsController = function(req, res, googleAnalyticsId) {
phantomasResults = phantomasResults.replace(/<\/script>/g, '\\u003c/script>');
var html = results.htmlTemplate;
html = strReplace(html, '%%METADATA%%', results.phantomasMetadata);
html = strReplace(html, '%%RESULTS%%', phantomasResults);
html = strReplace(html, '%%GA_ID%%', googleAnalyticsId);
-31
View File
@@ -23,7 +23,6 @@
<a class="menuItem back" href="/"><div class="icon-back"></div><span>New test<span></a>
<div class="menuItem" ng-if="!phantomasResults.error" ng-class="{active: view == 'summary'}" ng-click="setView('summary')"><div class="icon-summary"></div><span>Summary</span></div>
<div class="menuItem" ng-if="!phantomasResults.error" ng-class="{active: view == 'execution'}" ng-click="setView('execution')"><div class="icon-spaghetti"></div><span>JS Timeline</span></div>
<div class="menuItem" ng-if="!phantomasResults.error" ng-class="{active: view == 'metrics'}" ng-click="setView('metrics')"><div class="icon-metrics"></div><span>All Metrics</span></div>
</div>
<div ng-if="phantomasResults.error">
@@ -854,34 +853,6 @@
</div>
</div>
</div>
<div ng-show="view == 'metrics' && !phantomasResults.error" class="metrics">
<h2>Metrics from Phantomas report</h2>
<p><a href="https://github.com/macbre/phantomas" target="_blank">Phantomas</a> is a web performance metrics collector. You can find here the (almost) entire list of metrics from Phantomas.</p>
<div ng-repeat="(moduleName, module) in metricsModule">
<h4>{{moduleName}}</h4>
<div ng-repeat="(metricName, metric) in module" ng-if="phantomasResults.metrics[metricName] >= 0" class="module" id="metric_{{metricName}}">
<div class="value">
{{metricName}}: {{phantomasResults.metrics[metricName] | number: 0}}
<span ng-if="metric.unit == 'ms' || metric.unit == 'bytes' || metric.unit == '%'">{{metric.unit}}</span>
</div>
<div class="legend">
{{metric.desc}}
<span ng-if="metric.unreliable">(unreliable)</span>
</div>
<div ng-if="phantomasResults.offenders[metricName]" class="offenders">
<div ng-if="!metric.showingOffenders" ng-click="metric.showingOffenders = true">Show offenders</div>
<div ng-if="metric.showingOffenders" ng-click="metric.showingOffenders = false">Hide offenders</div>
<ul ng-if="metric.showingOffenders">
<li ng-repeat="offender in phantomasResults.offenders[metricName] track by $index">
{{offender}}
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
@@ -892,8 +863,6 @@
var _phantomas_results = %%RESULTS%%;
var _phantomas_metadata = %%METADATA%%;
var GA_ID = '%%GA_ID%%';
if (GA_ID.length > 0 && window.location.host === 'yellowlab.tools') {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g class="svgGrid" id="svgGrid"><line stroke-width="1" stroke="#B35047" x1="32" x2="32" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="64" x2="64" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="96" x2="96" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="128" x2="128" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="160" x2="160" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="192" x2="192" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="224" x2="224" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="256" x2="256" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="288" x2="288" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="320" x2="320" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="352" x2="352" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="384" x2="384" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="416" x2="416" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="448" x2="448" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="480" x2="480" y1="0" y2="512"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="32" y2="32"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="64" y2="64"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="96" y2="96"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="128" y2="128"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="160" y2="160"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="192" y2="192"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="224" y2="224"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="256" y2="256"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="288" y2="288"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="320" y2="320"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="352" y2="352"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="384" y2="384"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="416" y2="416"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="448" y2="448"></line><line stroke-width="1" stroke="#B35047" x1="0" x2="512" y1="480" y2="480"></line><rect x="0" y="0" width="512" height="512" fill="none" stroke-width="1" stroke="#B35047"></rect></g><path d="M 449.248,0.00 L 482.87,285.78 L 445.13,290.22 L 415.104,35.00 L 96.896,35.00 L 66.87,290.22 L 29.13,285.78 L 62.751,0.00 ZM 128.00,64.00L 384.00,64.00L 384.00,96.00L 128.00,96.00zM 128.00,128.00L 384.00,128.00L 384.00,160.00L 128.00,160.00zM 128.00,192.00L 384.00,192.00L 384.00,224.00L 128.00,224.00zM 128.00,256.00L 384.00,256.00L 384.00,288.00L 128.00,288.00zM 496.00,320.00L 16.00,320.00 c-8.80,0.00-13.723,6.83-10.94,15.179L 58.94,496.821C 61.723,505.17, 71.20,512.00, 80.00,512.00l 352.00,0.00 c 8.80,0.00, 18.276-6.83, 21.06-15.179l 53.881-161.643C 509.724,326.83, 504.80,320.00, 496.00,320.00z M 320.00,384.00L 192.00,384.00 l0.00-32.00 l 128.00,0.00 L 320.00,384.00 z" ></path></svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

-14
View File
@@ -3,7 +3,6 @@ var app = angular.module('Results', []);
app.controller('ResultsCtrl', function ($scope) {
// Grab results from nodeJS served page
$scope.phantomasResults = window._phantomas_results;
$scope.phantomasMetadata = window._phantomas_metadata.metrics;
$scope.view = 'summary';
@@ -20,7 +19,6 @@ app.controller('ResultsCtrl', function ($scope) {
initSummaryView();
initJSTimelineView();
initMetricsView();
}
@@ -173,18 +171,6 @@ app.controller('ResultsCtrl', function ($scope) {
$scope.timelineMax = Math.max.apply(Math, $scope.timeline);
}
function initMetricsView() {
// Get the Phantomas modules from metadata
$scope.metricsModule = {};
for (var metricName in $scope.phantomasMetadata) {
var metric = $scope.phantomasMetadata[metricName];
if (!$scope.metricsModule[metric.module]) {
$scope.metricsModule[metric.module] = {};
}
$scope.metricsModule[metric.module][metricName] = metric;
}
}
function getDomComplexityScore() {
var note = 'A';
+14 -17
View File
@@ -1,27 +1,24 @@
@arrow-left3-font-family: "fontsmith-icons";
@arrow-left3-value: "\e007";
@arrow-left3: '"fontsmith-icons"' '"\\e007"';
@list-font-family: "fontsmith-icons";
@list-value: "\e002";
@list: '"fontsmith-icons"' '"\\e002"';
@warning-font-family: "fontsmith-icons";
@warning-value: "\e000";
@warning: '"fontsmith-icons"' '"\\e000"';
@eye-font-family: "fontsmith-icons";
@eye-value: "\e004";
@eye: '"fontsmith-icons"' '"\\e004"';
@question-font-family: "fontsmith-icons";
@question-value: "\e001";
@question: '"fontsmith-icons"' '"\\e001"';
@lab-font-family: "fontsmith-icons";
@lab-value: "\e003";
@lab: '"fontsmith-icons"' '"\\e003"';
@bars-font-family: "fontsmith-icons";
@bars-value: "\e006";
@bars: '"fontsmith-icons"' '"\\e006"';
@drawer3-font-family: "fontsmith-icons";
@drawer3-value: "\e005";
@drawer3: '"fontsmith-icons"' '"\\e005"';
@bars-value: "\e005";
@bars: '"fontsmith-icons"' '"\\e005"';
@warning-font-family: "fontsmith-icons";
@warning-value: "\e000";
@warning: '"fontsmith-icons"' '"\\e000"';
@arrow-left3-font-family: "fontsmith-icons";
@arrow-left3-value: "\e006";
@arrow-left3: '"fontsmith-icons"' '"\\e006"';
@question-font-family: "fontsmith-icons";
@question-value: "\e001";
@question: '"fontsmith-icons"' '"\\e001"';
@list-font-family: "fontsmith-icons";
@list-value: "\e002";
@list: '"fontsmith-icons"' '"\\e002"';
.icon-font-family(@char) {
font-family: ~`@{char}[0]`;
-3
View File
@@ -65,9 +65,6 @@ h1 span {
.icon-spaghetti {
.icon(@bars);
}
.icon-metrics {
.icon(@drawer3);
}
.icon-eye {
.icon(@eye);
}
+1 -14
View File
@@ -95,7 +95,7 @@ h1 span {
-webkit-font-smoothing: antialiased;
}
.icon-back:before {
content: "\e007";
content: "\e006";
}
.icon-summary {
font-family: "fontsmith-icons";
@@ -121,19 +121,6 @@ h1 span {
-webkit-font-smoothing: antialiased;
}
.icon-spaghetti:before {
content: "\e006";
}
.icon-metrics {
font-family: "fontsmith-icons";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.icon-metrics:before {
content: "\e005";
}
.icon-eye {