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

21 lines
448 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
tasks() {
var hash = {};
this._taskNames.forEach(task => {
hash[task] = {
Pids: null,
ResourceUsage: generateResources(),
Timestamp: Date.now(),
};
});
return hash;
},
});