UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

55 lines 3.97 kB
// SPDX-License-Identifier: Apache-2.0 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var RapidFireCommandDefinition_1; import { inject, injectable } from 'tsyringe-neo'; import { InjectTokens } from '../../core/dependency-injection/inject-tokens.js'; import { patchInject } from '../../core/dependency-injection/container-helper.js'; import { BaseCommandDefinition } from './base-command-definition.js'; import { CommandBuilder, CommandGroup, Subcommand } from '../../core/command-path-builders/command-builder.js'; import * as constants from '../../core/constants.js'; import { RapidFireCommand } from '../rapid-fire.js'; let RapidFireCommandDefinition = class RapidFireCommandDefinition extends BaseCommandDefinition { static { RapidFireCommandDefinition_1 = this; } logger; rapidFireCommand; constructor(logger, rapidFireCommand) { super(); this.logger = logger; this.rapidFireCommand = rapidFireCommand; this.rapidFireCommand = patchInject(rapidFireCommand, InjectTokens.RapidFireCommand, this.constructor.name); this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name); } static COMMAND_NAME = 'rapid-fire'; static LOAD_SUBCOMMAND_NAME = 'load'; static DESTROY_SUBCOMMAND_NAME = 'destroy'; static START = 'start'; static STOP = 'stop'; static ALL = 'all'; getCommandDefinition() { return new CommandBuilder(RapidFireCommandDefinition_1.COMMAND_NAME, 'Commands for performing load tests a Solo deployment', this.logger) .addCommandGroup(new CommandGroup(RapidFireCommandDefinition_1.LOAD_SUBCOMMAND_NAME, 'Run load tests using the network load generator with the selected class.') .addSubcommand(new Subcommand(RapidFireCommandDefinition_1.START, 'Start a rapid-fire load test using the selected class.', this.rapidFireCommand, this.rapidFireCommand.start, RapidFireCommand.START_FLAGS_LIST, [...constants.BASE_DEPENDENCIES], false)) .addSubcommand(new Subcommand(RapidFireCommandDefinition_1.STOP, 'Stop any running processes using the selected class.', this.rapidFireCommand, this.rapidFireCommand.stop, RapidFireCommand.STOP_FLAGS_LIST, [...constants.BASE_DEPENDENCIES], false))) .addCommandGroup(new CommandGroup(RapidFireCommandDefinition_1.DESTROY_SUBCOMMAND_NAME, 'Uninstall the Network Load Generator Helm chart and clean up resources.').addSubcommand(new Subcommand(RapidFireCommandDefinition_1.ALL, 'Uninstall the Network Load Generator Helm chart and remove all related resources.', this.rapidFireCommand, this.rapidFireCommand.destroy, RapidFireCommand.DESTROY_FLAGS_LIST, [...constants.BASE_DEPENDENCIES], false))) .build(); } }; RapidFireCommandDefinition = RapidFireCommandDefinition_1 = __decorate([ injectable(), __param(0, inject(InjectTokens.SoloLogger)), __param(1, inject(InjectTokens.RapidFireCommand)), __metadata("design:paramtypes", [Object, RapidFireCommand]) ], RapidFireCommandDefinition); export { RapidFireCommandDefinition }; //# sourceMappingURL=rapid-fire-command-definition.js.map