@grafana/k6-test-builder 0.8.14 → 0.8.16
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/dist/index.d.ts +11 -1
- package/dist/index.js +23 -17
- package/dist/module.js +23 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,19 @@ import { FocusEventHandler, AnchorHTMLAttributes, ReactNode, ElementType, ReactE
|
|
|
2
2
|
import { InvalidArchiveError } from "har-to-k6";
|
|
3
3
|
import { ThemeOptions } from "@material-ui/core/styles/createTheme";
|
|
4
4
|
import { GrafanaTheme2 } from "@grafana/data";
|
|
5
|
+
interface VUhBreakdown {
|
|
6
|
+
base_total_vuh: number;
|
|
7
|
+
protocol_vuh: number;
|
|
8
|
+
browser_vuh: number;
|
|
9
|
+
reduction_rate: number | null;
|
|
10
|
+
reduction_rate_breakdown: {
|
|
11
|
+
volume: number;
|
|
12
|
+
local_run: number;
|
|
13
|
+
} | null;
|
|
14
|
+
}
|
|
5
15
|
interface VuhStats {
|
|
6
16
|
vuh_usage: number | undefined;
|
|
7
|
-
|
|
17
|
+
vuh_breakdown: VUhBreakdown;
|
|
8
18
|
}
|
|
9
19
|
interface Metadata {
|
|
10
20
|
vuh: VuhStats;
|
package/dist/index.js
CHANGED
|
@@ -216,7 +216,7 @@ const $924f96bd0d5c630d$export$cc0ae9a5c96bcd6f = ()=>/*#__PURE__*/ (0, $gkIgo$r
|
|
|
216
216
|
const $1c4cc247633c6592$var$LOGGER_ENABLE_KEY = '__test_builder_logger_enabled__';
|
|
217
217
|
const $1c4cc247633c6592$var$K6_VERBOSE_LOGS = '_k6_verbose_logs_';
|
|
218
218
|
function $1c4cc247633c6592$var$isEnabled() {
|
|
219
|
-
return
|
|
219
|
+
return process.env.TARGET !== 'prod' || sessionStorage.getItem($1c4cc247633c6592$var$LOGGER_ENABLE_KEY);
|
|
220
220
|
}
|
|
221
221
|
function $1c4cc247633c6592$var$isVerboseEnabled() {
|
|
222
222
|
return !!sessionStorage.getItem($1c4cc247633c6592$var$K6_VERBOSE_LOGS) || !!sessionStorage.getItem($1c4cc247633c6592$var$LOGGER_ENABLE_KEY);
|
|
@@ -2531,16 +2531,16 @@ function $bd3480c18d26920e$var$_toPrimitive(t, r) {
|
|
|
2531
2531
|
return ("string" === r ? String : Number)(t);
|
|
2532
2532
|
}
|
|
2533
2533
|
class $bd3480c18d26920e$export$4e14bd654b94b4e9 {
|
|
2534
|
-
|
|
2535
|
-
* Decides if this instance is serialized as undefined or not
|
|
2536
|
-
* @private
|
|
2537
|
-
*/ constructor(postData, headers){
|
|
2534
|
+
constructor(postData, headers){
|
|
2538
2535
|
$bd3480c18d26920e$var$_defineProperty(this, "mimeType", 'text/plain');
|
|
2539
2536
|
$bd3480c18d26920e$var$_defineProperty(this, "comment", '');
|
|
2540
2537
|
$bd3480c18d26920e$var$_defineProperty(this, "text", void 0);
|
|
2541
2538
|
$bd3480c18d26920e$var$_defineProperty(this, "params", void 0);
|
|
2542
2539
|
$bd3480c18d26920e$var$_defineProperty(this, "decoded", void 0);
|
|
2543
|
-
|
|
2540
|
+
/**
|
|
2541
|
+
* Decides if this instance is serialized as undefined or not
|
|
2542
|
+
* @private
|
|
2543
|
+
*/ $bd3480c18d26920e$var$_defineProperty(this, "isUndefined", false);
|
|
2544
2544
|
if (!postData || !headers || !postData.type) throw new TypeError('PostDataNode could not be created. Invalid arguments.');
|
|
2545
2545
|
switch(postData.type){
|
|
2546
2546
|
case 'text':
|
|
@@ -4186,11 +4186,11 @@ class $09bbc5e14b02adac$export$3fb97e8df001f5f7 extends SyntaxError {
|
|
|
4186
4186
|
}
|
|
4187
4187
|
}
|
|
4188
4188
|
class $09bbc5e14b02adac$export$dbf96015a8a67c16 {
|
|
4189
|
-
// @ts-ignore
|
|
4190
4189
|
constructor(id, scenarios, loadZones, thresholds, apm = []){
|
|
4191
4190
|
$09bbc5e14b02adac$var$_defineProperty(this, $09bbc5e14b02adac$var$ID, null);
|
|
4192
4191
|
$09bbc5e14b02adac$var$_defineProperty(this, $09bbc5e14b02adac$var$ARCHIVES, []);
|
|
4193
4192
|
$09bbc5e14b02adac$var$_defineProperty(this, $09bbc5e14b02adac$var$SCRIPTS, []);
|
|
4193
|
+
// @ts-ignore
|
|
4194
4194
|
$09bbc5e14b02adac$var$_defineProperty(this, $09bbc5e14b02adac$var$BASE_OPTIONS, void 0);
|
|
4195
4195
|
this.id = id;
|
|
4196
4196
|
this.baseOptions = $09bbc5e14b02adac$export$dbf96015a8a67c16.createLogOptions(loadZones, thresholds, apm);
|
|
@@ -15691,19 +15691,19 @@ const $723b70ee4d7f62e8$export$1ae172e61ce3735b = /*#__PURE__*/ (0, $gkIgo$react
|
|
|
15691
15691
|
|
|
15692
15692
|
|
|
15693
15693
|
|
|
15694
|
-
const $4e99116d1d1b712a$
|
|
15695
|
-
|
|
15696
|
-
const
|
|
15697
|
-
const
|
|
15698
|
-
const
|
|
15699
|
-
const
|
|
15694
|
+
const $4e99116d1d1b712a$var$VUH_THRESHOLD = 100;
|
|
15695
|
+
const $4e99116d1d1b712a$export$f4f5234705b8ee7d = ({ vuh_breakdown: vuh_breakdown, vuh_usage: vuh_usage = 0 })=>{
|
|
15696
|
+
const { base_total_vuh: base_total_vuh = 0, reduction_rate: reduction_rate = 0 } = vuh_breakdown;
|
|
15697
|
+
const original = (0, $4bac6ee95b8c8b72$export$24567f54a9be5ab9)(base_total_vuh);
|
|
15698
|
+
const reduced = (0, $4bac6ee95b8c8b72$export$24567f54a9be5ab9)(vuh_usage);
|
|
15699
|
+
const percentage = reduction_rate !== null && reduction_rate !== void 0 ? reduction_rate : 0;
|
|
15700
|
+
const costText = $4e99116d1d1b712a$export$f1b66467ef7e1dfd(original);
|
|
15701
|
+
const reductionText = $4e99116d1d1b712a$export$753b48ee12fd002c(reduced, percentage);
|
|
15700
15702
|
return /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)($4e99116d1d1b712a$var$Container, {
|
|
15701
15703
|
children: [
|
|
15702
15704
|
/*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)("span", {
|
|
15703
15705
|
children: [
|
|
15704
|
-
|
|
15705
|
-
original,
|
|
15706
|
-
" Virtual User Hours (VUh)",
|
|
15706
|
+
costText,
|
|
15707
15707
|
reductionText
|
|
15708
15708
|
]
|
|
15709
15709
|
}),
|
|
@@ -15714,6 +15714,12 @@ const $4e99116d1d1b712a$export$f4f5234705b8ee7d = ({ vuh: vuh })=>{
|
|
|
15714
15714
|
]
|
|
15715
15715
|
});
|
|
15716
15716
|
};
|
|
15717
|
+
const $4e99116d1d1b712a$export$f1b66467ef7e1dfd = (value)=>{
|
|
15718
|
+
return `Your test is estimated to consume ${value} Virtual User Hours (VUh)`;
|
|
15719
|
+
};
|
|
15720
|
+
const $4e99116d1d1b712a$export$753b48ee12fd002c = (value = 0, percentage = 0)=>{
|
|
15721
|
+
return percentage > 0 ? `, but you will only be charged for ${value} VUh. Tests consuming more than ${$4e99116d1d1b712a$var$VUH_THRESHOLD} VUh receive volume reductions based on test size.` : `. Tests consuming less than ${$4e99116d1d1b712a$var$VUH_THRESHOLD} Vuh are not eligible for volume reductions.`;
|
|
15722
|
+
};
|
|
15717
15723
|
const $4e99116d1d1b712a$var$Container = /*#__PURE__*/ (0, ($parcel$interopDefault($gkIgo$styledcomponents))).div.withConfig({
|
|
15718
15724
|
displayName: "VUhTooltipContent__Container",
|
|
15719
15725
|
componentId: "sc-1lz5zhl-0"
|
|
@@ -15739,7 +15745,7 @@ const $420b9b2911eb0b31$export$692b9323eea6a0ee = ()=>{
|
|
|
15739
15745
|
if (!(vuh !== null && vuh !== void 0 && vuh.vuh_usage)) return null;
|
|
15740
15746
|
return /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)((0, $gkIgo$materialuicore.Tooltip), {
|
|
15741
15747
|
title: /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)((0, $4e99116d1d1b712a$export$f4f5234705b8ee7d), {
|
|
15742
|
-
vuh
|
|
15748
|
+
...vuh
|
|
15743
15749
|
}),
|
|
15744
15750
|
interactive: true,
|
|
15745
15751
|
children: /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)((0, $7091d48bbccc61e3$export$eb2fcfdbd7ba97d4), {
|
package/dist/module.js
CHANGED
|
@@ -192,7 +192,7 @@ const $a80b21e889559c22$export$cc0ae9a5c96bcd6f = ()=>/*#__PURE__*/ (0, $b7VBt$j
|
|
|
192
192
|
const $77857f570335d7ae$var$LOGGER_ENABLE_KEY = '__test_builder_logger_enabled__';
|
|
193
193
|
const $77857f570335d7ae$var$K6_VERBOSE_LOGS = '_k6_verbose_logs_';
|
|
194
194
|
function $77857f570335d7ae$var$isEnabled() {
|
|
195
|
-
return
|
|
195
|
+
return process.env.TARGET !== 'prod' || sessionStorage.getItem($77857f570335d7ae$var$LOGGER_ENABLE_KEY);
|
|
196
196
|
}
|
|
197
197
|
function $77857f570335d7ae$var$isVerboseEnabled() {
|
|
198
198
|
return !!sessionStorage.getItem($77857f570335d7ae$var$K6_VERBOSE_LOGS) || !!sessionStorage.getItem($77857f570335d7ae$var$LOGGER_ENABLE_KEY);
|
|
@@ -2507,16 +2507,16 @@ function $f4684ac194011611$var$_toPrimitive(t, r) {
|
|
|
2507
2507
|
return ("string" === r ? String : Number)(t);
|
|
2508
2508
|
}
|
|
2509
2509
|
class $f4684ac194011611$export$4e14bd654b94b4e9 {
|
|
2510
|
-
|
|
2511
|
-
* Decides if this instance is serialized as undefined or not
|
|
2512
|
-
* @private
|
|
2513
|
-
*/ constructor(postData, headers){
|
|
2510
|
+
constructor(postData, headers){
|
|
2514
2511
|
$f4684ac194011611$var$_defineProperty(this, "mimeType", 'text/plain');
|
|
2515
2512
|
$f4684ac194011611$var$_defineProperty(this, "comment", '');
|
|
2516
2513
|
$f4684ac194011611$var$_defineProperty(this, "text", void 0);
|
|
2517
2514
|
$f4684ac194011611$var$_defineProperty(this, "params", void 0);
|
|
2518
2515
|
$f4684ac194011611$var$_defineProperty(this, "decoded", void 0);
|
|
2519
|
-
|
|
2516
|
+
/**
|
|
2517
|
+
* Decides if this instance is serialized as undefined or not
|
|
2518
|
+
* @private
|
|
2519
|
+
*/ $f4684ac194011611$var$_defineProperty(this, "isUndefined", false);
|
|
2520
2520
|
if (!postData || !headers || !postData.type) throw new TypeError('PostDataNode could not be created. Invalid arguments.');
|
|
2521
2521
|
switch(postData.type){
|
|
2522
2522
|
case 'text':
|
|
@@ -4162,11 +4162,11 @@ class $d875af20a6533bde$export$3fb97e8df001f5f7 extends SyntaxError {
|
|
|
4162
4162
|
}
|
|
4163
4163
|
}
|
|
4164
4164
|
class $d875af20a6533bde$export$dbf96015a8a67c16 {
|
|
4165
|
-
// @ts-ignore
|
|
4166
4165
|
constructor(id, scenarios, loadZones, thresholds, apm = []){
|
|
4167
4166
|
$d875af20a6533bde$var$_defineProperty(this, $d875af20a6533bde$var$ID, null);
|
|
4168
4167
|
$d875af20a6533bde$var$_defineProperty(this, $d875af20a6533bde$var$ARCHIVES, []);
|
|
4169
4168
|
$d875af20a6533bde$var$_defineProperty(this, $d875af20a6533bde$var$SCRIPTS, []);
|
|
4169
|
+
// @ts-ignore
|
|
4170
4170
|
$d875af20a6533bde$var$_defineProperty(this, $d875af20a6533bde$var$BASE_OPTIONS, void 0);
|
|
4171
4171
|
this.id = id;
|
|
4172
4172
|
this.baseOptions = $d875af20a6533bde$export$dbf96015a8a67c16.createLogOptions(loadZones, thresholds, apm);
|
|
@@ -15667,19 +15667,19 @@ const $f90e6ac18264291c$export$1ae172e61ce3735b = /*#__PURE__*/ (0, $b7VBt$forwa
|
|
|
15667
15667
|
|
|
15668
15668
|
|
|
15669
15669
|
|
|
15670
|
-
const $7c10312fad43a1ee$
|
|
15671
|
-
|
|
15672
|
-
const
|
|
15673
|
-
const
|
|
15674
|
-
const
|
|
15675
|
-
const
|
|
15670
|
+
const $7c10312fad43a1ee$var$VUH_THRESHOLD = 100;
|
|
15671
|
+
const $7c10312fad43a1ee$export$f4f5234705b8ee7d = ({ vuh_breakdown: vuh_breakdown, vuh_usage: vuh_usage = 0 })=>{
|
|
15672
|
+
const { base_total_vuh: base_total_vuh = 0, reduction_rate: reduction_rate = 0 } = vuh_breakdown;
|
|
15673
|
+
const original = (0, $f54872b9dc7588c3$export$24567f54a9be5ab9)(base_total_vuh);
|
|
15674
|
+
const reduced = (0, $f54872b9dc7588c3$export$24567f54a9be5ab9)(vuh_usage);
|
|
15675
|
+
const percentage = reduction_rate !== null && reduction_rate !== void 0 ? reduction_rate : 0;
|
|
15676
|
+
const costText = $7c10312fad43a1ee$export$f1b66467ef7e1dfd(original);
|
|
15677
|
+
const reductionText = $7c10312fad43a1ee$export$753b48ee12fd002c(reduced, percentage);
|
|
15676
15678
|
return /*#__PURE__*/ (0, $b7VBt$jsxs)($7c10312fad43a1ee$var$Container, {
|
|
15677
15679
|
children: [
|
|
15678
15680
|
/*#__PURE__*/ (0, $b7VBt$jsxs)("span", {
|
|
15679
15681
|
children: [
|
|
15680
|
-
|
|
15681
|
-
original,
|
|
15682
|
-
" Virtual User Hours (VUh)",
|
|
15682
|
+
costText,
|
|
15683
15683
|
reductionText
|
|
15684
15684
|
]
|
|
15685
15685
|
}),
|
|
@@ -15690,6 +15690,12 @@ const $7c10312fad43a1ee$export$f4f5234705b8ee7d = ({ vuh: vuh })=>{
|
|
|
15690
15690
|
]
|
|
15691
15691
|
});
|
|
15692
15692
|
};
|
|
15693
|
+
const $7c10312fad43a1ee$export$f1b66467ef7e1dfd = (value)=>{
|
|
15694
|
+
return `Your test is estimated to consume ${value} Virtual User Hours (VUh)`;
|
|
15695
|
+
};
|
|
15696
|
+
const $7c10312fad43a1ee$export$753b48ee12fd002c = (value = 0, percentage = 0)=>{
|
|
15697
|
+
return percentage > 0 ? `, but you will only be charged for ${value} VUh. Tests consuming more than ${$7c10312fad43a1ee$var$VUH_THRESHOLD} VUh receive volume reductions based on test size.` : `. Tests consuming less than ${$7c10312fad43a1ee$var$VUH_THRESHOLD} Vuh are not eligible for volume reductions.`;
|
|
15698
|
+
};
|
|
15693
15699
|
const $7c10312fad43a1ee$var$Container = /*#__PURE__*/ (0, $b7VBt$styledcomponents).div.withConfig({
|
|
15694
15700
|
displayName: "VUhTooltipContent__Container",
|
|
15695
15701
|
componentId: "sc-1lz5zhl-0"
|
|
@@ -15715,7 +15721,7 @@ const $d8f115728c3a4b86$export$692b9323eea6a0ee = ()=>{
|
|
|
15715
15721
|
if (!(vuh !== null && vuh !== void 0 && vuh.vuh_usage)) return null;
|
|
15716
15722
|
return /*#__PURE__*/ (0, $b7VBt$jsx)((0, $b7VBt$Tooltip), {
|
|
15717
15723
|
title: /*#__PURE__*/ (0, $b7VBt$jsx)((0, $7c10312fad43a1ee$export$f4f5234705b8ee7d), {
|
|
15718
|
-
vuh
|
|
15724
|
+
...vuh
|
|
15719
15725
|
}),
|
|
15720
15726
|
interactive: true,
|
|
15721
15727
|
children: /*#__PURE__*/ (0, $b7VBt$jsxs)((0, $9d9ef6b1aa606543$export$eb2fcfdbd7ba97d4), {
|