You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$"Invalid JSON metrics content formatting. The metric value for '{keyValuePair.Name}' is not a valid numeric data type. Provided metric value is '{keyValuePair.Value}'",
Virtual Client provides a facility for script-based automation to emit metrics for capture as well. To enable metrics capture, scripts emit the metrics to a single/central file on the file
474
-
system. The file should be named ```test-metrics.json``` and should exist in the same directory as the script that generated it. The file contents should be a simple JSON-formatted structure
475
-
as illustrated below. Virtual Client will read this file and upload the metrics defined within alongside any out-of-box metrics already captured.
474
+
system. The file should be named ```test-metrics.json``` and should exist in the same directory as the script that generated it. There are two acceptable formats for test-metrics.json.
475
+
476
+
* The file contents are a simple JSON-formatted structure as illustrated below. Virtual Client will read this file and upload the metrics defined within, alongside any out-of-box metrics already captured.
476
477
477
478
```json
478
479
# Example contents of the 'test-metrics.json' file. Simple key/value pairs. This file should
@@ -489,6 +490,64 @@ and requirements.
489
490
}
490
491
```
491
492
493
+
* The file contents are formatted as a JSON array as illustrated below. Virtual Client will read this file and upload the metrics defined within, alongside any out-of-box metrics already captured.
494
+
495
+
``` json
496
+
# Example contents of the 'test-metrics.json' file. JSON Array based structure. This file should
497
+
# be written to the same directory where the script that generated it exists. Here, 'metricName' and 'metricValue' are mandatory fields, while 'metricUnit' and 'metricMetadata' are optional. The field 'metricMetadata' can be used to provide additional information about the metric, such as the source of the metric or any other relevant context. It is a key-value pair structure.
498
+
#
499
+
# e.g.
500
+
# Given a script /any.script.extensions.1.0.0/linux-x64/install.py, the file should be
501
+
# written to /any.script.extensions.1.0.0/linux-x64/test-metrics.json
502
+
503
+
[
504
+
{
505
+
"Name": "metric1",
506
+
"Value": 0,
507
+
"Unit": "unit1",
508
+
"MetaData": {
509
+
"metadata1": "m1",
510
+
"metadata2": "m2"
511
+
}
512
+
},
513
+
{
514
+
"Name": "metric2",
515
+
"Value": -1,
516
+
"Unit": "unit2",
517
+
"MetaData": {
518
+
"metadata1": "m3",
519
+
"metadata2": "m4"
520
+
}
521
+
},
522
+
{
523
+
"Name": "metric3",
524
+
"Value": 1.2,
525
+
"Unit": "unit3",
526
+
"MetaData": {
527
+
"metadata1": "m5",
528
+
"metadata2": "m6"
529
+
}
530
+
},
531
+
{
532
+
"Name": "metric4",
533
+
"Value": 1.0,
534
+
"MetaData": {
535
+
"metadata1": "m7",
536
+
"metadata2": "m8"
537
+
}
538
+
},
539
+
{
540
+
"Name": "metric5",
541
+
"Value": "1.24",
542
+
"Unit": "unit5"
543
+
},
544
+
{
545
+
"Name": "metric6",
546
+
"Value": "-5.8"
547
+
}
548
+
]
549
+
```
550
+
492
551
### Out-of-Box Components for Execution of Script-Based Automation
493
552
The following section provides examples of how scripts can be integrated into the Virtual Client using out-of-box features to integrate script-based
0 commit comments