Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.2.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.4.x

Signed-off-by: Gordon Smith <[email protected]>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	version.cmake
  • Loading branch information
GordonSmith committed Mar 6, 2025
2 parents 6a70854 + b2c9fae commit 00586ed
Show file tree
Hide file tree
Showing 13 changed files with 192 additions and 119 deletions.
10 changes: 0 additions & 10 deletions esp/src/eclwatch/LFDetailsWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ define([
contentWidget: null,
dataPatternsWidget: null,
sourceWidget: null,
defWidget: null,
xmlWidget: null,
filePartsWidget: null,
queriesWidget: null,
Expand All @@ -95,7 +94,6 @@ define([
this.contentWidget = registry.byId(this.id + "_Content");
this.dataPatternsWidget = registry.byId(this.id + "_DataPatterns");
this.sourceWidget = registry.byId(this.id + "_Source");
this.defWidget = registry.byId(this.id + "_DEF");
this.xmlWidget = registry.byId(this.id + "_XML");
this.filePartsWidget = registry.byId(this.id + "_FileParts");
this.queriesWidget = registry.byId(this.id + "_Queries");
Expand Down Expand Up @@ -306,13 +304,6 @@ define([
this.sourceWidget.init({
ECL: this.logicalFile.Ecl
});
} else if (currSel.id === this.defWidget.id) {
var context = this;
this.logicalFile.fetchDEF(function (response) {
context.defWidget.init({
ECL: response
});
});
} else if (currSel.id === this.xmlWidget.id) {
var context = this;
this.logicalFile.fetchXML(function (response) {
Expand Down Expand Up @@ -403,7 +394,6 @@ define([
}
this.contentWidget.reset();
this.sourceWidget.reset();
this.defWidget.reset();
this.xmlWidget.reset();
this.filePartsWidget.reset();
this.widget._Queries.reset();
Expand Down
2 changes: 0 additions & 2 deletions esp/src/eclwatch/templates/LFDetailsWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ <h2>
</div>
<div id="${id}_Source" title="${i18n.ECL}" data-dojo-props="delayWidget: 'ECLSourceWidget', disabled: true" data-dojo-type="DelayLoadWidget">
</div>
<div id="${id}_DEF" title="${i18n.DEF}" data-dojo-props="delayWidget: 'ECLSourceWidget', disabled: true" data-dojo-type="DelayLoadWidget">
</div>
<div id="${id}_XML" title="${i18n.XML}" data-dojo-props="delayProps: {WUXml: true}, delayWidget: 'ECLSourceWidget', disabled: true" data-dojo-type="DelayLoadWidget">
</div>
<div id="${id}_FileBelongs" title="${i18n.Superfiles}" data-dojo-props="delayWidget: 'FileBelongsToWidget', disabled: true" data-dojo-type="DelayLoadWidget">
Expand Down
8 changes: 4 additions & 4 deletions esp/src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion esp/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@hpcc-js/chart": "2.86.0",
"@hpcc-js/codemirror": "2.65.0",
"@hpcc-js/common": "2.73.0",
"@hpcc-js/comms": "2.99.0",
"@hpcc-js/comms": "2.99.1",
"@hpcc-js/dataflow": "8.1.7",
"@hpcc-js/eclwatch": "2.76.1",
"@hpcc-js/graph": "2.87.0",
Expand Down
7 changes: 6 additions & 1 deletion esp/src/src-react/components/ECLArchiveTree.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { FlatTree, useHeadlessFlatTree_unstable, HeadlessFlatTreeItemProps, TreeItem, TreeItemLayout, CounterBadge } from "@fluentui/react-components";
import { FluentIconsProps, FolderOpen20Regular, Folder20Regular, FolderOpen20Filled, Folder20Filled, Document20Regular, Document20Filled, Important16Regular } from "@fluentui/react-icons";
import { Archive, isAttribute } from "../util/metricArchive";
import { Archive, isAttribute, UNNAMED_QUERY } from "../util/metricArchive";

type FlatItem = HeadlessFlatTreeItemProps & { fileTimePct?: number, content: string };

Expand Down Expand Up @@ -57,6 +57,9 @@ export const ECLArchiveTree: React.FunctionComponent<ECLArchiveTreeProps> = ({
fileTimePct: isAttribute(modAttr) && Math.round((archive?.sourcePathTime(modAttr.sourcePath) / archive?.timeTotalExecute) * 100),
});
});
if (archive?.query.content) {
flatTreeItems.push({ value: UNNAMED_QUERY, parentValue: undefined, content: UNNAMED_QUERY });
}
setFlatTreeItems(flatTreeItems.sort((a, b) => a.value.toString().localeCompare(b.value.toString(), undefined, { sensitivity: "base" })));
}, [archive, archive?.modAttrs, archive?.timeTotalExecute]);

Expand All @@ -65,6 +68,8 @@ export const ECLArchiveTree: React.FunctionComponent<ECLArchiveTreeProps> = ({
const modAttr = archive?.modAttrs.find(modAttr => modAttr.id === attrId);
if (modAttr?.type === "Attribute") {
setSelectedItem(attrId, archive.metricIDs(attrId));
} else if (attrId === UNNAMED_QUERY) {
setSelectedItem(attrId, []);
}
}, [archive, setSelectedItem]);

Expand Down
7 changes: 0 additions & 7 deletions esp/src/src-react/components/FileDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const FileDetails: React.FunctionComponent<FileDetailsProps> = ({
replaceUrl(`/files/${file.NodeGroup}/${logicalFile}`);
}
}, [cluster, file?.NodeGroup, file?.isSuperfile, logicalFile]);
const [defFile] = useDefFile(cluster, logicalFile, WsDfu.DFUDefFileFormat.def);
const [xmlFile] = useDefFile(cluster, logicalFile, WsDfu.DFUDefFileFormat.xml);

const onTabSelect = React.useCallback((tab: TabInfo) => {
Expand All @@ -69,9 +68,6 @@ export const FileDetails: React.FunctionComponent<FileDetailsProps> = ({
}, {
id: "ecl",
label: nlsHPCC.ECL,
}, {
id: "def",
label: nlsHPCC.DEF,
}, {
id: "xml",
label: nlsHPCC.XML,
Expand Down Expand Up @@ -130,9 +126,6 @@ export const FileDetails: React.FunctionComponent<FileDetailsProps> = ({
<DelayLoadedPanel visible={tab === "ecl"} size={size}>
<SourceEditor text={file?.Ecl} mode="ecl" readonly={true} />
</DelayLoadedPanel>
<DelayLoadedPanel visible={tab === "def"} size={size}>
<XMLSourceEditor text={defFile} readonly={true} />
</DelayLoadedPanel>
<DelayLoadedPanel visible={tab === "xml"} size={size}>
<XMLSourceEditor text={xmlFile} readonly={true} />
</DelayLoadedPanel>
Expand Down
8 changes: 6 additions & 2 deletions esp/src/src-react/components/MetricsPropertiesTables.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import * as React from "react";
import { useConst } from "@fluentui/react-hooks";
import { Palette } from "@hpcc-js/common";
import { IScope } from "@hpcc-js/comms";
import { ColumnFormat, Table } from "@hpcc-js/dgrid";
import { formatDecimal } from "src/Utility";
import { formatTwoDigits } from "src/Session";
import nlsHPCC from "src/nlsHPCC";
import { IScopeEx } from "../hooks/metrics";
import { AutosizeHpccJSComponent } from "../layouts/HpccJSAdapter";

Palette.rainbow("StdDevs", ["white", "white", "#fff0f0", "#ffC0C0", "#ff8080", "#ff0000", "#ff0000"]);

export interface MetricsPropertiesTablesProps {
scopesTableColumns?: string[];
scopes?: IScope[];
scopes?: IScopeEx[];
}

export const MetricsPropertiesTables: React.FunctionComponent<MetricsPropertiesTablesProps> = ({
Expand Down Expand Up @@ -44,6 +45,9 @@ export const MetricsPropertiesTables: React.FunctionComponent<MetricsPropertiesT
const props = [];
scopes.forEach((item, idx) => {
const scopeProps = [];
for (const exception of item.__exceptions ?? []) {
scopeProps.push([exception.Severity, exception.Message, `${formatTwoDigits(+exception.Priority / 1000)}s`, "", "", "", "", "", "", "", "", 6]);
}
for (const key in item.__groupedProps) {
const row = item.__groupedProps[key];
scopeProps.push([row.Key, row.Value, row.Avg, row.Min, row.Max, row.Delta, row.StdDev === undefined ? "" : `${row.StdDev} (${formatDecimal(row.StdDevs)}σ)`, row.SkewMin, row.SkewMax, row.NodeMin, row.NodeMax, row.StdDevs]);
Expand Down
10 changes: 6 additions & 4 deletions esp/src/src-react/components/MetricsScopes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ export class ScopesTable extends Table {
field = filter.substring(0, colonIdx);
}
if (field) {
const value: string = !matchCase ? row[field]?.toString().toLowerCase() : row[field]?.toString();
const rawValue: string = !matchCase ? row[field]?.toString().toLowerCase() : row[field]?.toString();
const formattedValue: string = !matchCase ? row.__formattedProps[field]?.toString().toLowerCase() : row.__formattedProps[field]?.toString();
const filterValue: string = !matchCase ? filter.toLowerCase() : filter;
return value?.indexOf(filterValue.substring(colonIdx + 1)) >= 0 ?? false;
return (rawValue?.indexOf(filterValue.substring(colonIdx + 1)) >= 0 || formattedValue?.indexOf(filterValue.substring(colonIdx + 1)) >= 0) ?? false;
}
for (const field in row) {
const value: string = !matchCase ? row[field].toString().toLowerCase() : row[field].toString();
const rawValue: string = !matchCase ? row[field]?.toString().toLowerCase() : row[field]?.toString();
const formattedValue: string = !matchCase ? row.__formattedProps[field]?.toString().toLowerCase() : row.__formattedProps[field]?.toString();
const filterValue: string = !matchCase ? filter.toLowerCase() : filter;
return value?.indexOf(filterValue) >= 0 ?? false;
return (rawValue?.indexOf(filterValue) >= 0 || formattedValue?.indexOf(filterValue) >= 0) ?? false;
}
return false;
}
Expand Down
1 change: 1 addition & 0 deletions esp/src/src-react/components/controls/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const gridStyles = (height: string): Partial<IDetailsListStyles> => {
selectors: {
".ms-DetailsHeader-cellName": { fontSize: "13.5px" },
".ms-DetailsRow": { userSelect: "text", borderBottom: "1px solid var(--colorNeutralBackground5)" },
".ms-DetailsRow-cell": { borderRight: "1px solid var(--colorNeutralBackground5)" },
".ms-DetailsRow-cell:has(.bgFilled)": { color: "white", boxShadow: "inset 1px 0 var(--colorNeutralBackground1), inset -1px 1px var(--colorNeutralBackground1)" },
".ms-DetailsRow-cell:has(.bgGreen)": { background: "green" },
".ms-DetailsRow-cell:has(.bgOrange)": { background: "orange" },
Expand Down
84 changes: 53 additions & 31 deletions esp/src/src-react/hooks/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,18 @@ export interface useMetricsResult {
refresh: () => void;
}

export interface IScopeEx extends IScope {
__exceptions?: WsWorkunits.ECLException[],
}

export function useWorkunitMetrics(
wuid: string,
scopeFilter: Partial<WsWorkunits.ScopeFilter> = scopeFilterDefault,
nestedFilter: WsWorkunits.NestedFilter = nestedFilterDefault
): useMetricsResult {

const [workunit, state] = useWorkunit(wuid);
const [data, setData] = React.useState<IScope[]>([]);
const [data, setData] = React.useState<IScopeEx[]>([]);
const [columns, setColumns] = React.useState<{ [id: string]: any }>([]);
const [activities, setActivities] = React.useState<WsWorkunits.Activity2[]>([]);
const [properties, setProperties] = React.useState<WsWorkunits.Property2[]>([]);
Expand All @@ -281,40 +285,58 @@ export function useWorkunitMetrics(

React.useEffect(() => {
if (wuid && workunit) {
const fetchInfo = singletonDebounce(workunit, "fetchInfo");
const fetchDetailsNormalized = singletonDebounce(workunit, "fetchDetailsNormalized");
setStatus(FetchStatus.STARTED);
fetchDetailsNormalized({
ScopeFilter: scopeFilter,
NestedFilter: nestedFilter,
PropertiesToReturn: {
AllScopes: true,
AllAttributes: true,
AllProperties: true,
AllNotes: true,
AllStatistics: true,
AllHints: true
},
ScopeOptions: {
IncludeId: true,
IncludeScope: true,
IncludeScopeType: true,
IncludeMatchedScopesInResults: true
},
PropertyOptions: {
IncludeName: true,
IncludeRawValue: true,
IncludeFormatted: true,
IncludeMeasure: true,
IncludeCreator: false,
IncludeCreatorType: false
Promise.all([
fetchInfo({ IncludeExceptions: true }),
fetchDetailsNormalized({
ScopeFilter: scopeFilter,
NestedFilter: nestedFilter,
PropertiesToReturn: {
AllScopes: true,
AllAttributes: true,
AllProperties: true,
AllNotes: true,
AllStatistics: true,
AllHints: true
},
ScopeOptions: {
IncludeId: true,
IncludeScope: true,
IncludeScopeType: true,
IncludeMatchedScopesInResults: true
},
PropertyOptions: {
IncludeName: true,
IncludeRawValue: true,
IncludeFormatted: true,
IncludeMeasure: true,
IncludeCreator: false,
IncludeCreatorType: false
}
})
]).then(([info, response]) => {
const exceptionsMap: { [scope: string]: WsWorkunits.ECLException[] } = {};
for (const exception of info?.Workunit?.Exceptions?.ECLException ?? []) {
if (exception.Scope) {
if (!exceptionsMap[exception.Scope]) {
exceptionsMap[exception.Scope] = [];
}
exceptionsMap[exception.Scope].push(exception);
}
}
}).then(response => {
setData(response?.data);
setData(response?.data.map(row => {
if (exceptionsMap[row.name]) {
row.__exceptions = exceptionsMap[row.name];
}
return row;
}));
setColumns(response?.columns);
setActivities(response?.meta?.Activities?.Activity || []);
setProperties(response?.meta?.Properties?.Property || []);
setMeasures(response?.meta?.Measures?.Measure || []);
setScopeTypes(response?.meta?.ScopeTypes?.ScopeType || []);
setActivities(response?.meta?.Activities?.Activity ?? []);
setProperties(response?.meta?.Properties?.Property ?? []);
setMeasures(response?.meta?.Measures?.Measure ?? []);
setScopeTypes(response?.meta?.ScopeTypes?.ScopeType ?? []);
}).catch(e => {
logger.error(e);
}).finally(() => {
Expand Down
4 changes: 3 additions & 1 deletion esp/src/src-react/util/metricArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { IScope } from "@hpcc-js/comms";
import { XMLNode, xml2json } from "@hpcc-js/util";
import nlsHPCC from "src/nlsHPCC";

export const UNNAMED_QUERY = "<unnamed query>";

export class Archive {
build: string = "";
eclVersion: string = "";
Expand Down Expand Up @@ -125,7 +127,7 @@ export class Archive {
}

content(attrId: string) {
const attr = this.attribute(attrId);
const attr = attrId === UNNAMED_QUERY ? this.query : this.attribute(attrId);
return attr?.content ?? "";
}

Expand Down
Loading

0 comments on commit 00586ed

Please sign in to comment.