| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import type {OperationDescription} from './Operation'; |
| 9 | |
| 10 | import {Operation} from './Operation'; |
| 11 | |
| 12 | export class NopOperation extends Operation { |
| 13 | static opName = 'Nop'; |
| 14 | |
| 15 | constructor(private durationSeconds = 2) { |
| 16 | super('NopOperation'); |
| 17 | } |
| 18 | |
| 19 | getDescriptionForDisplay(): OperationDescription | undefined { |
| 20 | return { |
| 21 | description: `sleep ${this.durationSeconds}`, |
| 22 | }; |
| 23 | } |
| 24 | |
| 25 | getArgs() { |
| 26 | return [ |
| 27 | 'debugprogress', |
| 28 | '3', |
| 29 | '--with-output', |
| 30 | '1', |
| 31 | '--sleep', |
| 32 | String(Math.floor((this.durationSeconds * 1000) / 3)), |
| 33 | ]; |
| 34 | } |
| 35 | } |
| 36 | |