2017-09-19 14:47:10 +00:00
|
|
|
import { Factory } from 'ember-cli-mirage';
|
2018-04-21 01:10:41 +00:00
|
|
|
import generateResources from '../data/generate-resources';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
export default Factory.extend({
|
|
|
|
resourceUsage: generateResources,
|
|
|
|
|
|
|
|
_taskNames: () => [], // Set by allocation
|
|
|
|
|
|
|
|
tasks() {
|
|
|
|
var hash = {};
|
|
|
|
this._taskNames.forEach(task => {
|
|
|
|
hash[task] = {
|
|
|
|
Pids: null,
|
|
|
|
ResourceUsage: generateResources(),
|
|
|
|
Timestamp: Date.now(),
|
|
|
|
};
|
|
|
|
});
|
|
|
|
return hash;
|
|
|
|
},
|
|
|
|
});
|