open-nomad/ui/mirage/factories/client-allocation-stat.js

23 lines
500 B
JavaScript
Raw Normal View History

2017-09-19 14:47:10 +00:00
import { Factory } from 'ember-cli-mirage';
import generateResources from '../data/generate-resources';
2017-09-19 14:47:10 +00:00
export default Factory.extend({
resourceUsage: generateResources,
_taskNames: () => [], // Set by allocation
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(),
Timestamp: Date.now() * 1000000,
2017-09-19 14:47:10 +00:00
};
});
return hash;
},
});