size_util.go ×4

Frontier kind: Code frontier

unlabeled · c_b3d74543d88e

291 tests · 2285 LOC · 94 files · introduces 0 tests · 104 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges104 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
397 ranges2285 lines · 94 files · Browse complete extent
All tests (intent)
291 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

3 files ranked by introduced lines: 104 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/size.go 87 introduced LOC · 2 ranges

Open complete file

10 state *persistencespb.WorkflowMutableState,
11 historyStatistics *HistoryStatistics,
12 > ) *MutableStateStatistics { size.go
13 > if internalState == nil {
14 return nil
15 }
16
17 > executionInfoSize := sizeOfBlob(internalState.ExecutionInfo) size.go
18 > executionStateSize := sizeOfBlob(internalState.ExecutionState)
19 >
20 > totalActivityCount := state.ExecutionInfo.ActivityCount
21 > activityInfoCount := len(internalState.ActivityInfos)
22 > activityInfoSize := sizeOfInt64BlobMap(internalState.ActivityInfos)
23 >
24 > totalUserTimerCount := state.ExecutionInfo.UserTimerCount
25 > timerInfoCount := len(internalState.TimerInfos)
26 > timerInfoSize := sizeOfStringBlobMap(internalState.TimerInfos)
27 >
28 > totalChildExecutionCount := state.ExecutionInfo.ChildExecutionCount
29 > childExecutionInfoCount := len(internalState.ChildExecutionInfos)
30 > childExecutionInfoSize := sizeOfInt64BlobMap(internalState.ChildExecutionInfos)
31 >
32 > totalRequestCancelExternalCount := state.ExecutionInfo.RequestCancelExternalCount
33 > requestCancelInfoCount := len(internalState.RequestCancelInfos)
34 > requestCancelInfoSize := sizeOfInt64BlobMap(internalState.RequestCancelInfos)
35 >
36 > totalSignalExternalCount := state.ExecutionInfo.SignalExternalCount
37 > signalInfoCount := len(internalState.SignalInfos)
38 > signalInfoSize := sizeOfInt64BlobMap(internalState.SignalInfos)
39 >
40 > totalSignalCount := state.ExecutionInfo.SignalCount
41 > signalRequestIDCount := len(internalState.SignalRequestedIDs)
42 > signalRequestIDSize := sizeOfStringSlice(internalState.SignalRequestedIDs)
43 >
44 > bufferedEventsCount := len(internalState.BufferedEvents)
45 > bufferedEventsSize := sizeOfBlobSlice(internalState.BufferedEvents)
46 >
47 > totalUpdateCount := state.ExecutionInfo.UpdateCount
48 > updateInfoCount := len(state.ExecutionInfo.UpdateInfos)
49 >
50 > chasmTotalSize := sizeOfChasmNodeMap(internalState.ChasmNodes)
51 >
52 > totalSize := executionInfoSize
53 > totalSize += executionStateSize
54 > totalSize += activityInfoSize
55 > totalSize += timerInfoSize
56 > totalSize += childExecutionInfoSize
57 > totalSize += requestCancelInfoSize
58 > totalSize += signalInfoSize
59 > totalSize += signalRequestIDSize
60 > totalSize += bufferedEventsSize
61 > totalSize += chasmTotalSize
62 >
63 > return &MutableStateStatistics{
64 > TotalSize: totalSize,
65 > HistoryStatistics: historyStatistics,
66 >
67 > ExecutionInfoSize: executionInfoSize,
68 > ExecutionStateSize: executionStateSize,
69 >
70 > ActivityInfoSize: activityInfoSize,
71 > ActivityInfoCount: activityInfoCount,
72 > TotalActivityCount: totalActivityCount,
73 >
74 > TimerInfoSize: timerInfoSize,
75 > TimerInfoCount: timerInfoCount,
76 > TotalUserTimerCount: totalUserTimerCount,
77 >
78 > ChildInfoSize: childExecutionInfoSize,
79 > ChildInfoCount: childExecutionInfoCount,
80 > TotalChildExecutionCount: totalChildExecutionCount,
81 >
82 > RequestCancelInfoSize: requestCancelInfoSize,
83 > RequestCancelInfoCount: requestCancelInfoCount,
84 > TotalRequestCancelExternalCount: totalRequestCancelExternalCount,
85 >
86 > SignalInfoSize: signalInfoSize,
87 > SignalInfoCount: signalInfoCount,
88 > TotalSignalExternalCount: totalSignalExternalCount,
89 >
90 > SignalRequestIDSize: signalRequestIDSize,
91 > SignalRequestIDCount: signalRequestIDCount,
92 > TotalSignalCount: totalSignalCount,
93 >
94 > BufferedEventsSize: bufferedEventsSize,
95 > BufferedEventsCount: bufferedEventsCount,
96 >
97 > UpdateInfoCount: updateInfoCount,
98 > TotalUpdateCount: totalUpdateCount,
99 >
100 > ChasmTotalSize: chasmTotalSize,
101 > }
102 }
103
go.temporal.io/server/common/persistence/execution_manager.go 9 introduced LOC · 3 ranges

Open complete file

484 return nil, respErr
485 }
486 > state, err := m.toWorkflowMutableState(response.State) execution_manager.go
487 > if err != nil {
488 return nil, err
489 }
490 > if state.ExecutionInfo.ExecutionStats == nil { execution_manager.go
491 state.ExecutionInfo.ExecutionStats = &persistencespb.ExecutionStats{
492 HistorySize: 0,
494 }
495
496 > newResponse := &GetWorkflowExecutionResponse{ execution_manager.go
497 > State: state,
498 > DBRecordVersion: response.DBRecordVersion,
499 > MutableStateStats: *statusOfInternalWorkflow(response.State, state, nil),
500 > }
501 > return newResponse, respErr
502 }
503
go.temporal.io/server/common/persistence/size_util.go 8 introduced LOC · 4 ranges

Open complete file

64 func sizeOfStringSlice(
65 stringSlice []string,
66 > ) int { size_util.go
67 > size := 0
68 > for _, str := range stringSlice {
69 size += len(str)
70 }
71 > return size size_util.go
72 }
73
74 func sizeOfBlobSlice(
75 blobSlice []*commonpb.DataBlob,
76 > ) int { size_util.go
77 > size := 0
78 > for _, blob := range blobSlice {
79 size += blob.Size()
80 }
81 > return size size_util.go
82 }