visibility_queue_task_executor.go ×6

Frontier kind: Code frontier

unlabeled · c_ff52e7bb0a7f

13 tests · 5703 LOC · 209 files · introduces 0 tests · 39 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges39 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1076 ranges5703 lines · 209 files · Browse complete extent
All tests (intent)
13 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: 39 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/visibility_queue_task_executor.go 24 introduced LOC · 6 ranges

Open complete file

620 mutableState historyi.MutableState,
621 namespaceEntry *namespace.Namespace,
622 > ) (*manager.RecordWorkflowExecutionClosedRequest, error) { visibility_queue_task_executor.go
623 > wfCloseTime, err := mutableState.GetWorkflowCloseTime(ctx)
624 > if err != nil {
625 return nil, err
626 }
627 > wfExecutionDuration, err := mutableState.GetWorkflowExecutionDuration(ctx) visibility_queue_task_executor.go
628 > if err != nil {
629 return nil, err
630 }
631 > historyLength := mutableState.GetNextEventID() - 1 visibility_queue_task_executor.go
632 > executionInfo := mutableState.GetExecutionInfo()
633 > stateTransitionCount := executionInfo.GetStateTransitionCount()
634 > historySizeBytes := executionInfo.GetExecutionStats().GetHistorySize()
635 >
636 > if base.SearchAttributes == nil {
637 base.SearchAttributes = &commonpb.SearchAttributes{
638 IndexedFields: make(map[string]*commonpb.Payload),
639 }
640 > } else if base.SearchAttributes.IndexedFields == nil { visibility_queue_task_executor.go
641 base.SearchAttributes.IndexedFields = make(map[string]*commonpb.Payload)
642 }
643
644 > if t.externalPayloadsEnabled(namespaceEntry.Name().String()) { visibility_queue_task_executor.go
645 > externalPayloadCount := executionInfo.GetExecutionStats().GetExternalPayloadCount()
646 > externalPayloadSizeBytes := executionInfo.GetExecutionStats().GetExternalPayloadSize()
647 > if externalPayloadCount > 0 {
648 externalPayloadCountPayload := sadefs.MustEncodeValue(externalPayloadCount, enumspb.INDEXED_VALUE_TYPE_INT)
649 externalPayloadSizeBytesPayload := sadefs.MustEncodeValue(externalPayloadSizeBytes, enumspb.INDEXED_VALUE_TYPE_INT)
653 }
654
655 > return &manager.RecordWorkflowExecutionClosedRequest{ visibility_queue_task_executor.go
656 > VisibilityRequestBase: base,
657 > CloseTime: wfCloseTime,
658 > ExecutionDuration: wfExecutionDuration,
659 > HistoryLength: historyLength,
660 > HistorySizeBytes: historySizeBytes,
661 > StateTransitionCount: stateTransitionCount,
662 > }, nil
663 }
664
go.temporal.io/server/api/persistence/v1/executions.pb.go 10 introduced LOC · 4 ranges

Open complete file

823 }
824
825 > func (x *WorkflowExecutionInfo) GetExecutionStats() *ExecutionStats { executions.pb.go
826 > if x != nil {
827 > return x.ExecutionStats
828 > }
829 return nil
830 }
1407 }
1408
1409 > func (x *ExecutionStats) GetHistorySize() int64 { executions.pb.go
1410 > if x != nil {
1411 return x.HistorySize
1412 }
1414 }
1415
1416 > func (x *ExecutionStats) GetExternalPayloadSize() int64 { executions.pb.go
1417 > if x != nil {
1418 return x.ExternalPayloadSize
1419 }
1421 }
1422
1423 > func (x *ExecutionStats) GetExternalPayloadCount() int64 { executions.pb.go
1424 > if x != nil {
1425 return x.ExternalPayloadCount
1426 }
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 5 introduced LOC · 3 ranges

Open complete file

1936 // GetWorkflowExecutionDuration returns the workflow execution duration.
1937 // Returns zero for open workflow.
1938 > func (ms *MutableStateImpl) GetWorkflowExecutionDuration(ctx context.Context) (time.Duration, error) { mutable_state_impl.go
1939 > closeTime, err := ms.GetWorkflowCloseTime(ctx)
1940 > if err != nil {
1941 return 0, err
1942 }
1943 > if closeTime.IsZero() || ms.executionInfo.ExecutionTime == nil { mutable_state_impl.go
1944 return 0, nil
1945 }
1946 > return closeTime.Sub(ms.executionInfo.ExecutionTime.AsTime()), nil mutable_state_impl.go
1947 }
1948