@hpcc-js/comms 3.7.6 → 3.7.7
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/browser/index.js +3673 -1568
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -6
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +134 -49
- package/dist/node/index.cjs.map +4 -4
- package/dist/node/index.js +134 -49
- package/dist/node/index.js.map +4 -4
- package/package.json +7 -7
- package/src/__package__.ts +2 -2
- package/src/ecl/query.ts +23 -10
- package/src/ecl/workunit.ts +61 -42
- package/types/__package__.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/comms",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"description": "hpcc-js - Communications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/node/index.cjs",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"wsdl-all": "npm-run-all --aggregate-output -c --serial build --parallel wsdl-*"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@hpcc-js/util": "^3.3.
|
|
75
|
+
"@hpcc-js/util": "^3.3.9",
|
|
76
76
|
"@xmldom/xmldom": "0.9.8",
|
|
77
77
|
"abort-controller": "3.0.0",
|
|
78
78
|
"node-fetch": "3.3.2",
|
|
79
|
-
"undici": "
|
|
79
|
+
"undici": "7.12.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@hpcc-js/ddl-shim": "^3.0.0",
|
|
83
|
-
"@hpcc-js/esbuild-plugins": "^1.4.
|
|
84
|
-
"@kubernetes/client-node": "1.
|
|
83
|
+
"@hpcc-js/esbuild-plugins": "^1.4.9",
|
|
84
|
+
"@kubernetes/client-node": "1.3.0",
|
|
85
85
|
"@types/d3-request": "1.0.9",
|
|
86
86
|
"@types/d3-time-format": "2.3.4",
|
|
87
87
|
"@types/node": "^18",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"d3-time-format": "^2",
|
|
92
92
|
"data-uri-to-buffer": "6.0.2",
|
|
93
93
|
"safe-buffer": "5.2.1",
|
|
94
|
-
"soap": "1.
|
|
94
|
+
"soap": "1.2.0",
|
|
95
95
|
"tmp": "0.2.3",
|
|
96
96
|
"typescript-formatter": "^7.2.2"
|
|
97
97
|
},
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"esp",
|
|
113
113
|
"HPCC-Platform"
|
|
114
114
|
],
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "92489547b0e57f479a691236b1a47e977b43cf2e"
|
|
116
116
|
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/comms";
|
|
2
|
-
export const PKG_VERSION = "3.7.
|
|
3
|
-
export const BUILD_VERSION = "3.
|
|
2
|
+
export const PKG_VERSION = "3.7.7";
|
|
3
|
+
export const BUILD_VERSION = "3.9.1";
|
package/src/ecl/query.ts
CHANGED
|
@@ -172,20 +172,31 @@ export class Query extends StateObject<QueryEx, QueryEx> implements QueryEx {
|
|
|
172
172
|
const meta = promises[1];
|
|
173
173
|
const metrics: WsWorkunits.Scope[] = promises[2];
|
|
174
174
|
const data = metrics.map(metric => {
|
|
175
|
-
|
|
175
|
+
const firstChar = metric.Id[0];
|
|
176
|
+
if (firstChar === "a" || firstChar === "e") {
|
|
176
177
|
const item = graph.idx[metric.Id.substring(1)];
|
|
178
|
+
if (!item) {
|
|
179
|
+
logger.debug(`Missing graph data for metric ID: ${metric.Id}`);
|
|
180
|
+
return metric;
|
|
181
|
+
}
|
|
182
|
+
const existingProperties = new Set(metric.Properties.Property.map(prop => prop.Name));
|
|
183
|
+
const newProperties: WsWorkunits.Property[] = [];
|
|
177
184
|
for (const key in item) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
const firstCharOfKey = key.charAt(0);
|
|
186
|
+
if (firstCharOfKey !== "_" &&
|
|
187
|
+
firstCharOfKey === firstCharOfKey.toUpperCase() &&
|
|
188
|
+
!existingProperties.has(key)) {
|
|
189
|
+
const value = item[key];
|
|
190
|
+
const valueType = typeof value;
|
|
191
|
+
if (valueType === "string" || valueType === "number" || valueType === "boolean") {
|
|
192
|
+
const isNum = isNumber(value);
|
|
193
|
+
let rawValue = isNum ? parseFloat(value as string) : value;
|
|
194
|
+
let formatted = value;
|
|
184
195
|
if (key.indexOf("Time") >= 0) {
|
|
185
|
-
rawValue = rawValue as number / 1000000000;
|
|
196
|
+
rawValue = (rawValue as number) / 1000000000;
|
|
186
197
|
formatted = siFormatter(rawValue) + "s";
|
|
187
198
|
}
|
|
188
|
-
|
|
199
|
+
newProperties.push({
|
|
189
200
|
Name: key,
|
|
190
201
|
RawValue: rawValue as any,
|
|
191
202
|
Formatted: formatted
|
|
@@ -193,10 +204,12 @@ export class Query extends StateObject<QueryEx, QueryEx> implements QueryEx {
|
|
|
193
204
|
}
|
|
194
205
|
}
|
|
195
206
|
}
|
|
207
|
+
if (newProperties.length > 0) {
|
|
208
|
+
metric.Properties.Property.push(...newProperties);
|
|
209
|
+
}
|
|
196
210
|
}
|
|
197
211
|
return metric;
|
|
198
212
|
});
|
|
199
|
-
|
|
200
213
|
return wu.normalizeDetails(meta, data);
|
|
201
214
|
});
|
|
202
215
|
}
|
package/src/ecl/workunit.ts
CHANGED
|
@@ -675,50 +675,60 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
675
675
|
Measure: "label"
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
const
|
|
679
|
-
for (const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
678
|
+
const activityMap = new Map<number, string>();
|
|
679
|
+
for (const activity of meta.Activities?.Activity ?? []) {
|
|
680
|
+
activityMap.set(activity.Kind, activity.Name);
|
|
681
|
+
}
|
|
682
|
+
const data: IScope[] = new Array(scopes.length);
|
|
683
|
+
for (let i = 0; i < scopes.length; i++) {
|
|
684
|
+
const scope = scopes[i];
|
|
685
|
+
const props: { [key: string]: any } = {};
|
|
686
|
+
const formattedProps: { [key: string]: any } = {};
|
|
687
|
+
if (scope.Id && scope.Properties?.Property) {
|
|
688
|
+
for (const scopeProperty of scope.Properties.Property) {
|
|
689
|
+
const measure = scopeProperty.Measure;
|
|
690
|
+
const name = scopeProperty.Name;
|
|
691
|
+
const rawValue = scopeProperty.RawValue;
|
|
692
|
+
if (measure === "ns") {
|
|
686
693
|
scopeProperty.Measure = "s";
|
|
687
694
|
}
|
|
688
|
-
if (
|
|
689
|
-
const
|
|
690
|
-
scopeProperty.Formatted =
|
|
695
|
+
if (name === "Kind") {
|
|
696
|
+
const rawValueInt = parseInt(rawValue, 10);
|
|
697
|
+
scopeProperty.Formatted = activityMap.get(rawValueInt) ?? rawValue;
|
|
691
698
|
}
|
|
692
|
-
columns[
|
|
693
|
-
|
|
694
|
-
|
|
699
|
+
columns[name] = {
|
|
700
|
+
Name: scopeProperty.Name,
|
|
701
|
+
Measure: scopeProperty.Measure,
|
|
702
|
+
Creator: scopeProperty.Creator,
|
|
703
|
+
CreatorType: scopeProperty.CreatorType
|
|
704
|
+
};
|
|
695
705
|
switch (scopeProperty.Measure) {
|
|
696
706
|
case "bool":
|
|
697
|
-
props[
|
|
707
|
+
props[name] = !!+rawValue;
|
|
698
708
|
break;
|
|
699
709
|
case "sz":
|
|
700
|
-
props[
|
|
710
|
+
props[name] = +rawValue;
|
|
701
711
|
break;
|
|
702
712
|
case "s":
|
|
703
|
-
props[
|
|
713
|
+
props[name] = +rawValue / 1000000000;
|
|
704
714
|
break;
|
|
705
715
|
case "ns":
|
|
706
|
-
props[
|
|
716
|
+
props[name] = +rawValue;
|
|
707
717
|
break;
|
|
708
718
|
case "ts":
|
|
709
|
-
props[
|
|
719
|
+
props[name] = new Date(+rawValue / 1000).toISOString();
|
|
710
720
|
break;
|
|
711
721
|
case "cnt":
|
|
712
|
-
props[
|
|
722
|
+
props[name] = +rawValue;
|
|
713
723
|
break;
|
|
714
724
|
case "cost":
|
|
715
|
-
props[
|
|
725
|
+
props[name] = +rawValue / 1000000;
|
|
716
726
|
break;
|
|
717
727
|
case "node":
|
|
718
|
-
props[
|
|
728
|
+
props[name] = +rawValue;
|
|
719
729
|
break;
|
|
720
730
|
case "skw":
|
|
721
|
-
props[
|
|
731
|
+
props[name] = +rawValue;
|
|
722
732
|
break;
|
|
723
733
|
case "cpu":
|
|
724
734
|
case "ppm":
|
|
@@ -729,11 +739,10 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
729
739
|
case "id":
|
|
730
740
|
case "fname":
|
|
731
741
|
default:
|
|
732
|
-
props[
|
|
742
|
+
props[name] = rawValue;
|
|
733
743
|
}
|
|
734
|
-
formattedProps[
|
|
744
|
+
formattedProps[name] = formatNum(scopeProperty.Formatted ?? props[name]);
|
|
735
745
|
}
|
|
736
|
-
// Other properties ---
|
|
737
746
|
}
|
|
738
747
|
const normalizedScope: IScope = {
|
|
739
748
|
id: scope.Id,
|
|
@@ -748,37 +757,47 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
748
757
|
__StdDevsSource: "",
|
|
749
758
|
...props
|
|
750
759
|
};
|
|
751
|
-
|
|
760
|
+
const definitionList = normalizedScope[DEFINITION_LIST];
|
|
761
|
+
if (definitionList) {
|
|
752
762
|
try {
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
763
|
+
const parsedList = JSON.parse(definitionList.split("\\").join("\\\\"));
|
|
764
|
+
const processedDefinitions: Array<{ filePath: string, line: number, col: number }> = [];
|
|
765
|
+
|
|
766
|
+
for (let k = 0; k < parsedList.length; k++) {
|
|
767
|
+
const matches = parsedList[k].match(definitionRegex);
|
|
757
768
|
if (matches) {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
769
|
+
processedDefinitions.push({
|
|
770
|
+
filePath: (matches[1] ?? "") + matches[2] + matches[3],
|
|
771
|
+
line: parseInt(matches[5], 10),
|
|
772
|
+
col: parseInt(matches[6], 10)
|
|
773
|
+
});
|
|
762
774
|
}
|
|
763
|
-
}
|
|
775
|
+
}
|
|
776
|
+
normalizedScope[DEFINITION_LIST] = processedDefinitions;
|
|
764
777
|
} catch (e) {
|
|
765
|
-
logger.error(`Unexpected "DefinitionList":
|
|
778
|
+
logger.error(`Unexpected "DefinitionList": ${definitionList}`);
|
|
766
779
|
}
|
|
767
780
|
}
|
|
781
|
+
|
|
768
782
|
const dedup: DedupProperties = {};
|
|
783
|
+
let maxStdDevs = 0;
|
|
784
|
+
let maxStdDevsSource = "";
|
|
769
785
|
for (const key in normalizedScope) {
|
|
770
|
-
if (key.
|
|
786
|
+
if (!key.startsWith("__")) {
|
|
771
787
|
const row = formatValues(normalizedScope, key, dedup);
|
|
772
788
|
if (row) {
|
|
773
789
|
normalizedScope.__groupedProps[row.Key] = row;
|
|
774
|
-
if (!isNaN(row.StdDevs) &&
|
|
775
|
-
|
|
776
|
-
|
|
790
|
+
if (!isNaN(row.StdDevs) && row.StdDevs > maxStdDevs) {
|
|
791
|
+
maxStdDevs = row.StdDevs;
|
|
792
|
+
maxStdDevsSource = row.Key;
|
|
777
793
|
}
|
|
778
794
|
}
|
|
779
795
|
}
|
|
780
796
|
}
|
|
781
|
-
|
|
797
|
+
normalizedScope.__StdDevs = maxStdDevs;
|
|
798
|
+
normalizedScope.__StdDevsSource = maxStdDevsSource;
|
|
799
|
+
|
|
800
|
+
data[i] = normalizedScope;
|
|
782
801
|
}
|
|
783
802
|
return {
|
|
784
803
|
meta,
|
package/types/__package__.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/comms";
|
|
2
|
-
export declare const PKG_VERSION = "3.7.
|
|
3
|
-
export declare const BUILD_VERSION = "3.
|
|
2
|
+
export declare const PKG_VERSION = "3.7.6";
|
|
3
|
+
export declare const BUILD_VERSION = "3.9.0";
|