
This enables a new "artifact"-based configuration file format, intended to work natively with the deployer and to aid future efforts to visualize additional data sources. Among other tweaks, dataset indices are no longer used as the primary differentiator between data files, and instead artifact names (such as `testrepository.subunit`) are used to group related artfacts of various types, such as 'subunit', 'subunit-stats', and 'subunit-details'. Additionally, datasets and artifacts now have access to substantially more metadata about the job that generated the output data. In future patches, this metadata will be used to display and link to additional information about visualized data. This metadata is made available automatically by the deployer, and can be optionally gathered from environment variables when using `stackviz-export` via a new `--env` flag. Change-Id: I3e16cc314624a1b7b4f6bf43fa4d5cdeedcdba0c
38 lines
961 B
JavaScript
38 lines
961 B
JavaScript
'use strict';
|
|
|
|
var directivesModule = require('./_index.js');
|
|
|
|
/**
|
|
* @ngInject
|
|
*/
|
|
function tempestSummary() {
|
|
|
|
/**
|
|
* Responsible for getting the basic run summary stats via the dataset service.
|
|
* Also calculates the duration of the run - `timeDiff` - by subtracting the
|
|
* run's start and end timestamps.
|
|
* @ngInject
|
|
*/
|
|
var controller = function($scope, $attrs, datasetService) {
|
|
$scope.$watch('artifactName', function(artifactName) {
|
|
datasetService.artifact(artifactName, 'subunit-stats').then(function(response) {
|
|
var stats = response.data;
|
|
$scope.stats = stats;
|
|
$scope.timeDiff = (new Date(stats.end) - new Date(stats.start)) / 1000;
|
|
});
|
|
});
|
|
};
|
|
|
|
return {
|
|
restrict: 'EA',
|
|
scope: {
|
|
'index': '=',
|
|
'artifactName': '='
|
|
},
|
|
controller: controller,
|
|
templateUrl: 'directives/tempest-summary.html'
|
|
};
|
|
}
|
|
|
|
directivesModule.directive('tempestSummary', tempestSummary);
|