github.com/hspak/nomad@v0.7.2-0.20180309000617-bc4ae22a39a5/ui/mirage/factories/deployment-task-group-summary.js (about)

     1  import { Factory, faker } from 'ember-cli-mirage';
     2  
     3  export default Factory.extend({
     4    name: '',
     5  
     6    autoRevert: () => Math.random() > 0.5,
     7    promoted: () => Math.random() > 0.5,
     8  
     9    desiredTotal: faker.random.number({ min: 1, max: 10 }),
    10  
    11    desiredCanaries() {
    12      return faker.random.number(Math.floor(this.desiredTotal / 2));
    13    },
    14  
    15    placedCanaries() {
    16      return faker.random.number(this.desiredCanaries);
    17    },
    18  
    19    placedAllocs() {
    20      return faker.random.number(this.desiredTotal);
    21    },
    22  
    23    healthyAllocs() {
    24      return faker.random.number(this.placedAllocs);
    25    },
    26  
    27    unhealthyAllocs() {
    28      return this.placedAllocs - this.healthyAllocs;
    29    },
    30  });