mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
28 lines
579 B
JavaScript
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;
|
|
},
|
|
});
|