github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/ui/mirage/factories/client-allocation-stats.js (about) 1 import { Factory } from 'ember-cli-mirage'; 2 import generateResources from '../data/generate-resources'; 3 4 export default Factory.extend({ 5 resourceUsage: generateResources, 6 7 _taskNames: () => [], // Set by allocation 8 9 tasks() { 10 var hash = {}; 11 this._taskNames.forEach(task => { 12 hash[task] = { 13 Pids: null, 14 ResourceUsage: generateResources(), 15 Timestamp: Date.now(), 16 }; 17 }); 18 return hash; 19 }, 20 });