Skip to content

Commit 0f3a4d9

Browse files
committed
fix: global stats not being recorded
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent f504600 commit 0f3a4d9

4 files changed

Lines changed: 49 additions & 5 deletions

File tree

packages/comms/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ <h1>ESM Quick Test</h1>
4343
testWUDetailsMeta("wuPlaceholder");
4444
</script>
4545

46-
<div id="placeholder" class="placeholder"></div>
46+
<div id="placeholder2" class="placeholder"></div>
47+
<script type="module">
48+
import { testWUDetails } from "./tests/index.ts";
49+
testWUDetails("placeholder2");
50+
</script>
51+
52+
<div id="placeholder3" class="placeholder"></div>
4753
<script type="module">
4854
import { testSMCGlobalMetrics } from "./tests/index.ts";
4955

50-
testSMCGlobalMetrics("placeholder");
56+
testSMCGlobalMetrics("placeholder3");
5157
</script>
5258
</body>
5359

packages/comms/src/ecl/workunit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
685685
const scope = scopes[i];
686686
const props: { [key: string]: any } = {};
687687
const formattedProps: { [key: string]: any } = {};
688-
if (scope.Id && scope.Properties?.Property) {
688+
if (scope.Properties?.Property) {
689689
for (const scopeProperty of scope.Properties.Property) {
690690
const measure = scopeProperty.Measure;
691691
const name = scopeProperty.Name;

packages/comms/tests/index.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SMCService, WorkunitsService } from "../src/index.browser.ts";
1+
import { SMCService, Workunit, WorkunitsService } from "../src/index.browser.ts";
22

33
export function testWUDetailsMeta(placeholder: string) {
44
const wuService = new WorkunitsService({ baseUrl: "http://localhost:8010" });
@@ -30,6 +30,44 @@ export function testWUDetailsMeta(placeholder: string) {
3030

3131
}
3232

33+
export async function testWUDetails(placeholder: string) {
34+
const wu = Workunit.attach({ baseUrl: "http://localhost:8010" }, "W20260219-100208-3");
35+
const wuPlaceholder = document.getElementById(placeholder);
36+
const response = await wu.fetchDetailsNormalized({
37+
ScopeFilter: {
38+
ScopeTypes: ["all"],
39+
},
40+
NestedFilter: {
41+
42+
},
43+
PropertiesToReturn: {
44+
AllScopes: true,
45+
AllAttributes: true,
46+
AllProperties: true,
47+
AllNotes: true,
48+
AllStatistics: true,
49+
AllHints: true
50+
},
51+
ScopeOptions: {
52+
IncludeId: true,
53+
IncludeScope: true,
54+
IncludeScopeType: true,
55+
IncludeMatchedScopesInResults: true
56+
},
57+
PropertyOptions: {
58+
IncludeName: true,
59+
IncludeRawValue: true,
60+
IncludeFormatted: true,
61+
IncludeMeasure: true,
62+
IncludeCreator: false,
63+
IncludeCreatorType: false
64+
}
65+
});
66+
if (wuPlaceholder) {
67+
wuPlaceholder.textContent = JSON.stringify(response.data, null, 2);
68+
}
69+
}
70+
3371
export function testSMCGlobalMetrics(placeholder: string) {
3472
const service = new SMCService({ baseUrl: "http://localhost:8010" });
3573
const placeholderElement = document.getElementById(placeholder);

packages/eclwatch/tests/test1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class WUTimelineNoFetch extends WUTimelinePatched {
5353
const wu = Workunit.attach({ baseUrl: "http://localhost:8010" }, "W20260219-100208-3");
5454
const response = await wu.fetchDetailsNormalized({
5555
ScopeFilter: {
56-
ScopeTypes: ["operation", "workflow", "graph", "subgraph", "activity", "edge"],
56+
ScopeTypes: ["all"],
5757
},
5858
NestedFilter: {
5959

0 commit comments

Comments
 (0)