@speedkit/cli 2.36.0 → 2.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.37.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.36.0...v2.37.0) (2024-07-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * **prewarm:** show minimal output on quietMode ([aa847d8](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/aa847d8c5ccaacbbcf94c1128973fb5af23f9e33))
7
+
1
8
  # [2.36.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.35.0...v2.36.0) (2024-06-27)
2
9
 
3
10
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
21
21
  $ sk COMMAND
22
22
  running command...
23
23
  $ sk (--version)
24
- @speedkit/cli/2.36.0 linux-x64 node-v20.15.0
24
+ @speedkit/cli/2.37.0 linux-x64 node-v20.15.0
25
25
  $ sk --help [COMMAND]
26
26
  USAGE
27
27
  $ sk COMMAND
@@ -12,6 +12,7 @@ export declare enum CliActionStatus {
12
12
  }
13
13
  export interface CliServiceInterface {
14
14
  style: chalk.Chalk;
15
+ readonly quiet: boolean;
15
16
  code(code: string, buffered?: boolean): void;
16
17
  codeStyle(code: string): string;
17
18
  comment(message: string, buffered?: boolean): void;
@@ -3,7 +3,7 @@ import { table } from "@oclif/core/lib/cli-ux/styled/table";
3
3
  import { Options } from "cli-progress";
4
4
  import { CliActionStatus, CliServiceInterface } from "./cli-service-model";
5
5
  export declare class CliService implements CliServiceInterface {
6
- private readonly quiet;
6
+ readonly quiet: boolean;
7
7
  style: chalk.Chalk;
8
8
  private buffer;
9
9
  private progressBar?;
@@ -6,6 +6,7 @@ export declare class PreWarmService {
6
6
  private cli;
7
7
  private urls;
8
8
  private variations;
9
+ private requestsSend;
9
10
  constructor(assetClient: AssetApiClient, cli: CliServiceInterface, urls: string[], variations: string[]);
10
11
  handleRequestCallback(assetClient: AssetApiClient, entry: AssetItemInterface): Promise<void>;
11
12
  run(): Promise<void>;
@@ -18,4 +19,5 @@ export declare class PreWarmService {
18
19
  private stopProgressBar;
19
20
  private updateProgressBar;
20
21
  private updateRateLimit;
22
+ private showMinimalStatusUpdate;
21
23
  }
@@ -10,6 +10,7 @@ class PreWarmService {
10
10
  cli;
11
11
  urls;
12
12
  variations;
13
+ requestsSend = 0;
13
14
  constructor(assetClient, cli, urls, variations) {
14
15
  this.assetClient = assetClient;
15
16
  this.cli = cli;
@@ -56,6 +57,8 @@ class PreWarmService {
56
57
  return;
57
58
  }
58
59
  this.cli.write("Retry rateLimited requests.");
60
+ // reset for minimal output
61
+ this.requestsSend = 0;
59
62
  const urlsToRetry = assetList
60
63
  .getByStatus(_1.ItemStatus.RETRY)
61
64
  .map((entry) => entry.url);
@@ -80,6 +83,7 @@ class PreWarmService {
80
83
  offset += batch.length;
81
84
  this.updateProgressBar(offset, assetList);
82
85
  await this.updateRateLimit(batch);
86
+ this.showMinimalStatusUpdate(batch, assetList);
83
87
  // fetch next batch
84
88
  await this.fetchBatch(assetList, offset);
85
89
  }
@@ -150,5 +154,17 @@ class PreWarmService {
150
154
  this.assetClient.reduceMaxRequestsPerSecond();
151
155
  }
152
156
  }
157
+ showMinimalStatusUpdate(batch, assetList) {
158
+ if (!this.cli.quiet) {
159
+ return;
160
+ }
161
+ this.requestsSend += batch.length;
162
+ const assetLength = assetList.getLength();
163
+ const errors = assetList.getErrorCount();
164
+ const success = assetList.getSuccessCount();
165
+ const retry = assetList.getRetryCount();
166
+ const currentRate = this.assetClient.getRateLimit();
167
+ this.cli.write(this.cli.style.gray(`${this.requestsSend}/${assetLength} | rate: ${currentRate} | success: ${success} | retry: ${retry} | errors: ${errors}`));
168
+ }
153
169
  }
154
170
  exports.PreWarmService = PreWarmService;
@@ -688,5 +688,5 @@
688
688
  ]
689
689
  }
690
690
  },
691
- "version": "2.36.0"
691
+ "version": "2.37.0"
692
692
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "2.36.0",
4
+ "version": "2.37.0",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"