open-nomad/ui/mirage/factories/client-allocation-stats.js
2018-04-20 18:10:41 -07:00

21 lines
448 B
JavaScript

import { Factory } from 'ember-cli-mirage';
import generateResources from '../data/generate-resources';
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;
},
});