size.go ×2

Frontier kind: Code frontier

unlabeled · c_0f99c3bf1ee2

90 tests · 2284 LOC · 94 files · introduces 0 tests · 108 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges108 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
376 ranges2284 lines · 94 files · Browse complete extent
All tests (intent)
90 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.

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

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

Open complete file

110 }
111
112 > executionInfoSize := sizeOfBlob(mutation.ExecutionInfoBlob) size.go
113 > executionStateSize := sizeOfBlob(mutation.ExecutionStateBlob)
114 >
115 > totalActivityCount := mutation.ExecutionInfo.ActivityCount
116 > activityInfoCount := len(mutation.UpsertActivityInfos)
117 > activityInfoCount += len(mutation.DeleteActivityInfos)
118 > activityInfoSize := sizeOfInt64BlobMap(mutation.UpsertActivityInfos)
119 > activityInfoSize += sizeOfInt64Set(mutation.DeleteActivityInfos)
120 >
121 > totalUserTimerCount := mutation.ExecutionInfo.UserTimerCount
122 > timerInfoCount := len(mutation.UpsertTimerInfos)
123 > timerInfoCount += len(mutation.DeleteTimerInfos)
124 > timerInfoSize := sizeOfStringBlobMap(mutation.UpsertTimerInfos)
125 > timerInfoSize += sizeOfStringSet(mutation.DeleteTimerInfos)
126 >
127 > totalChildExecutionCount := mutation.ExecutionInfo.ChildExecutionCount
128 > childExecutionInfoCount := len(mutation.UpsertChildExecutionInfos)
129 > childExecutionInfoCount += len(mutation.DeleteChildExecutionInfos)
130 > childExecutionInfoSize := sizeOfInt64BlobMap(mutation.UpsertChildExecutionInfos)
131 > childExecutionInfoSize += sizeOfInt64Set(mutation.DeleteChildExecutionInfos)
132 >
133 > totalRequestCancelExternalCount := mutation.ExecutionInfo.RequestCancelExternalCount
134 > requestCancelInfoCount := len(mutation.UpsertRequestCancelInfos)
135 > requestCancelInfoCount += len(mutation.DeleteRequestCancelInfos)
136 > requestCancelInfoSize := sizeOfInt64BlobMap(mutation.UpsertRequestCancelInfos)
137 > requestCancelInfoSize += sizeOfInt64Set(mutation.DeleteRequestCancelInfos)
138 >
139 > totalSignalExternalCount := mutation.ExecutionInfo.SignalExternalCount
140 > signalInfoCount := len(mutation.UpsertSignalInfos)
141 > signalInfoCount += len(mutation.DeleteSignalInfos)
142 > signalInfoSize := sizeOfInt64BlobMap(mutation.UpsertSignalInfos)
143 > signalInfoSize += sizeOfInt64Set(mutation.DeleteSignalInfos)
144 >
145 > totalSignalCount := mutation.ExecutionInfo.SignalCount
146 > signalRequestIDCount := len(mutation.UpsertSignalRequestedIDs)
147 > signalRequestIDCount += len(mutation.DeleteSignalRequestedIDs)
148 > signalRequestIDSize := sizeOfStringSet(mutation.UpsertSignalRequestedIDs)
149 > signalRequestIDSize += sizeOfStringSet(mutation.DeleteSignalRequestedIDs)
150 >
151 > totalUpdateCount := mutation.ExecutionInfo.UpdateCount
152 > updateInfoCount := len(mutation.ExecutionInfo.UpdateInfos)
153 >
154 > bufferedEventsCount := 0
155 > bufferedEventsSize := 0
156 > if mutation.NewBufferedEvents != nil {
157 bufferedEventsCount = 1
158 bufferedEventsSize = mutation.NewBufferedEvents.Size()
159 }
160
161 > taskCountByCategory := taskCountsByCategory(&mutation.Tasks) size.go
162 >
163 > chasmTotalSize := sizeOfChasmNodeMap(mutation.UpsertChasmNodes)
164 > chasmTotalSize += sizeOfStringSet(mutation.DeleteChasmNodes)
165 >
166 > // TODO what about checksum?
167 >
168 > totalSize := executionInfoSize
169 > totalSize += executionStateSize
170 > totalSize += activityInfoSize
171 > totalSize += timerInfoSize
172 > totalSize += childExecutionInfoSize
173 > totalSize += requestCancelInfoSize
174 > totalSize += signalInfoSize
175 > totalSize += signalRequestIDSize
176 > totalSize += bufferedEventsSize
177 > totalSize += chasmTotalSize
178 >
179 > return &MutableStateStatistics{
180 > TotalSize: totalSize,
181 > HistoryStatistics: historyStatistics,
182 >
183 > ExecutionInfoSize: executionInfoSize,
184 > ExecutionStateSize: executionStateSize,
185 >
186 > ActivityInfoSize: activityInfoSize,
187 > ActivityInfoCount: activityInfoCount,
188 > TotalActivityCount: totalActivityCount,
189 >
190 > TimerInfoSize: timerInfoSize,
191 > TimerInfoCount: timerInfoCount,
192 > TotalUserTimerCount: totalUserTimerCount,
193 >
194 > ChildInfoSize: childExecutionInfoSize,
195 > ChildInfoCount: childExecutionInfoCount,
196 > TotalChildExecutionCount: totalChildExecutionCount,
197 >
198 > RequestCancelInfoSize: requestCancelInfoSize,
199 > RequestCancelInfoCount: requestCancelInfoCount,
200 > TotalRequestCancelExternalCount: totalRequestCancelExternalCount,
201 >
202 > SignalInfoSize: signalInfoSize,
203 > SignalInfoCount: signalInfoCount,
204 > TotalSignalExternalCount: totalSignalExternalCount,
205 >
206 > SignalRequestIDSize: signalRequestIDSize,
207 > SignalRequestIDCount: signalRequestIDCount,
208 > TotalSignalCount: totalSignalCount,
209 >
210 > BufferedEventsSize: bufferedEventsSize,
211 > BufferedEventsCount: bufferedEventsCount,
212 >
213 > TaskCountByCategory: taskCountByCategory,
214 >
215 > TotalUpdateCount: totalUpdateCount,
216 > UpdateInfoCount: updateInfoCount,
217 >
218 > ChasmTotalSize: chasmTotalSize,
219 > }
220 }
221
go.temporal.io/server/common/persistence/size_util.go 4 introduced LOC · 1 range

Open complete file

13 func sizeOfInt64Set(
14 int64Set map[int64]struct{},
15 > ) int { size_util.go
16 > // 8 == 64 bit / 8 bit per byte
17 > return 8 * len(int64Set)
18 > }
19
20 func sizeOfStringSet(