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
|
|
|
|
|
2018-09-19 23:33:18 +00:00
|
|
|
timestamp: () => Date.now() * 1000000,
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
tasks() {
|
|
|
|
var hash = {};
|
|
|
|
this._taskNames.forEach(task => {
|
|
|
|
hash[task] = {
|
|
|
|
Pids: null,
|
|
|
|
ResourceUsage: generateResources(),
|
2018-09-19 23:33:18 +00:00
|
|
|
Timestamp: Date.now() * 1000000,
|
2017-09-19 14:47:10 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
return hash;
|
|
|
|
},
|
|
|
|
});
|