github.com/manicqin/nomad@v0.9.5/ui/mirage/factories/client-allocation-stat.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    timestamp: () => Date.now() * 1000000,
    10  
    11    tasks() {
    12      var hash = {};
    13      this._taskNames.forEach(task => {
    14        hash[task] = {
    15          Pids: null,
    16          ResourceUsage: generateResources(),
    17          Timestamp: Date.now() * 1000000,
    18        };
    19      });
    20      return hash;
    21    },
    22  });