github.com/emate/nomad@v0.8.2-wo-binpacking/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  });