Files
nomad/ui/mirage/factories/client-allocation-stat.js
2023-08-10 17:27:29 -05:00

28 lines
579 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { Factory } from 'ember-cli-mirage';
import generateResources from '../data/generate-resources';
export default Factory.extend({
resourceUsage: generateResources,
_taskNames: () => [], // Set by allocation
timestamp: () => Date.now() * 1000000,
tasks() {
var hash = {};
this._taskNames.forEach(task => {
hash[task] = {
Pids: null,
ResourceUsage: generateResources(),
Timestamp: Date.now() * 1000000,
};
});
return hash;
},
});