Bug 980596 - Fix html view of results created by get-metric-for-build;r=davehunt

This commit is contained in:
William Lachance 2014-03-06 18:07:53 -05:00
Родитель 204474b4d1
Коммит 8b556e0737
3 изменённых файлов: 21 добавлений и 20 удалений

Просмотреть файл

@ -89,7 +89,7 @@ def runtest(device_prefs, testname, options, apk=None, appname=None,
eideticker.get_standard_metrics(capture, testlog.actions)) eideticker.get_standard_metrics(capture, testlog.actions))
metadata['metrics'] = metrics metadata['metrics'] = metrics
metadata['framediffSums'] = videocapture.get_framediff_sums(capture) metadata['frameDiffSums'] = videocapture.get_framediff_sums(capture)
if options.outputdir: if options.outputdir:
# video # video

Просмотреть файл

@ -26,12 +26,12 @@ function updateGraph(rawdata, measure) {
// show individual data points // show individual data points
var graphdata = []; var graphdata = [];
var colorCounter = 0; var colorCounter = 0;
var metadataHash = {}; var uuidHash = {};
var seriesIndex = 0; var seriesIndex = 0;
var barPosition = 1; var barPosition = 1;
Object.keys(rawdata).sort().forEach(function(appname) { Object.keys(rawdata).sort().forEach(function(appname) {
metadataHash[seriesIndex] = []; uuidHash[seriesIndex] = [];
var label; var label;
var color = colorCounter; var color = colorCounter;
@ -60,8 +60,9 @@ function updateGraph(rawdata, measure) {
}; };
rawdata[appname].forEach(function(sample) { rawdata[appname].forEach(function(sample) {
series.data.push([ barPosition, sample[measure] ]); series.data.push([ barPosition, sample[measure] ]);
console.log(sample.uuid);
uuidHash[seriesIndex].push(sample.uuid);
metadataHash[seriesIndex].push({'videoURL': sample.video, 'appDate': sample.appdate, 'revision': sample.revision, 'buildId': sample.buildid, 'frameDiff': sample.frameDiff, 'fps': sample.captureFPS, 'generatedVideoFPS': sample.generatedVideoFPS });
barPosition++; barPosition++;
}); });
graphdata.push(series); graphdata.push(series);
@ -94,21 +95,21 @@ function updateGraph(rawdata, measure) {
$("#graph-container").bind("plotclick", function (event, pos, item) { $("#graph-container").bind("plotclick", function (event, pos, item) {
plot.unhighlight(); plot.unhighlight();
if (item) { if (item) {
var metadata = metadataHash[item.seriesIndex][item.dataIndex]; var uuid = uuidHash[item.seriesIndex][item.dataIndex];
$('#datapoint-info').html(ich.graphDatapoint({ 'date': null, $.getJSON('metadata/' + uuid + '.json', function(metadata) {
'videoURL': metadata.videoURL, $('#datapoint-info').html(ich.graphDatapoint({ 'uuid': uuid,
'measureName': measure, 'date': null,
'appDate': metadata.appDate, 'videoURL': metadata.video,
'revision': metadata.revision, 'measureName': measure,
'buildId': metadata.buildId, 'appDate': metadata.appDate,
'measureValue': Math.round(100.0*item.datapoint[1])/100.0, 'revision': metadata.revision,
'frameDiff': metadata.frameDiff, 'buildId': metadata.buildId,
'fps': metadata.fps, 'measureValue': Math.round(100.0*item.datapoint[1])/100.0,
'generatedVideoFPS': metadata.generatedVideoFPS 'frameDiff': (metadata.frameDiffSums) ? true : false
})); }));
$('#video').css('width', $('#video').parent().width()); $('#video').css('width', $('#video').parent().width());
$('#video').css('max-height', $('#graph-container').height()); $('#video').css('max-height', $('#graph-container').height());
});
plot.highlight(item.series, item.datapoint); plot.highlight(item.series, item.datapoint);
} else { } else {
$('#datapoint-info').html(null); $('#datapoint-info').html(null);

Просмотреть файл

@ -110,7 +110,7 @@
<dd>{{measureValue}}</dd> <dd>{{measureValue}}</dd>
</dl> </dl>
{{#frameDiff}} {{#frameDiff}}
<p><a href="framediff-view.html?title=Frame Difference&video={{videoURL}}&framediff={{frameDiff}}&fps={{fps}}&videoFPS={{videoFPS}}" target="_blank">Frame difference view</a></p> <p><a href="framediff-view.html?id={{uuid}}" target="_blank">Frame difference view</a></p>
{{/frameDiff}} {{/frameDiff}}
</div> </div>
</script> </script>