executable.go ×9

Frontier kind: Code frontier

unlabeled · c_d3cb2ec3c28b

236 tests · 2604 LOC · 132 files · introduces 0 tests · 61 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges61 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
395 ranges2604 lines · 132 files · Browse complete extent
All tests (intent)
236 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: 61 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/queues/executable.go 58 introduced LOC · 9 ranges

Open complete file

194 tracer trace.Tracer,
195 opts ...ExecutableOption,
196 > ) Executable { executable.go
197 > params := ExecutableParams{
198 > DLQEnabled: func() bool {
199 return false
200 },
210 },
211 }
212 > for _, opt := range opts { executable.go
213 opt(&params)
214 }
215 > e := &executableImpl{ executable.go
216 > Task: task,
217 > state: ctasks.TaskStatePending,
218 >
219 > executor: executor,
220 > scheduler: scheduler,
221 > rescheduler: rescheduler,
222 > priorityAssigner: priorityAssigner,
223 > timeSource: timeSource,
224 > namespaceRegistry: namespaceRegistry,
225 > clusterMetadata: clusterMetadata,
226 > chasmRegistry: chasmRegistry,
227 > taskTypeTagProvider: taskTypeTagProvider,
228 > readerID: readerID,
229 > logger: log.NewLazyLogger(
230 > logger,
231 > func() []tag.Tag {
232 return tasks.Tags(task)
233 },
241 dlqErrorPattern: params.DLQErrorPattern,
242 }
243 > e.refreshMetricsHandlers(nil) executable.go
244 > e.attempt.Store(1)
245 > e.priority = priorityAssigner.Assign(e)
246 >
247 > loadTime := util.MaxTime(timeSource.Now(), task.GetKey().FireTime)
248 > metrics.TaskLoadLatency.With(e.chasmMetricsHandler).Record(
249 > loadTime.Sub(task.GetVisibilityTime()),
250 > metrics.QueueReaderIDTag(readerID),
251 > )
252 > return e
253 }
254
762 }
763
764 > func (e *executableImpl) GetTask() tasks.Task { executable.go
765 > return e.Task
766 > }
767
768 func (e *executableImpl) GetScheduledTime() time.Time {
860 }
861
862 > func (e *executableImpl) refreshMetricsHandlers(executionMetricTags []metrics.Tag) { executable.go
863 > sharedTags := taskBaseMetricTagsWithoutArchetype(
864 > e.GetTask(),
865 > e.namespaceRegistry,
866 > e.clusterMetadata.GetCurrentClusterName(),
867 > e.chasmRegistry,
868 > e.taskTypeTagProvider,
869 > )
870 > if len(executionMetricTags) > 0 {
871 sharedTags = append(sharedTags, executionMetricTags...)
872 }
873 > e.defaultMetricsHandler = e.baseMetricsHandler.WithTags(sharedTags...) executable.go
874 > e.chasmMetricsHandler = e.defaultMetricsHandler.WithTags(getArchetypeTag(e.GetTask(), e.chasmRegistry))
875 }
876
892 chasmRegistry *chasm.Registry,
893 taskTypeTagProvider TaskTypeTagProvider,
894 > ) []metrics.Tag { executable.go
895 > namespaceTag := metrics.NamespaceUnknownTag()
896 > isActive := true
897 >
898 > ns, err := namespaceRegistry.GetNamespaceByID(namespace.ID(task.GetNamespaceID()))
899 > if err == nil {
900 namespaceTag = metrics.NamespaceTag(ns.Name().String())
901 isActive = ns.ActiveClusterName(namespace.RoutingKey{ID: task.GetWorkflowID()}) == currentClusterName
902 }
903
904 > taskType := taskTypeTagProvider(task, isActive, chasmRegistry) executable.go
905 > return []metrics.Tag{
906 > namespaceTag,
907 > metrics.TaskTypeTag(taskType),
908 > metrics.OperationTag(taskType), // for backward compatibility
909 > // TODO: add task priority tag here as well
910 > }
911 }
912
go.temporal.io/server/common/metrics/tags.go 3 introduced LOC · 1 range

Open complete file

362 }
363
364 > func QueueReaderIDTag(readerID int64) Tag { tags.go
365 > return Tag{Key: QueueReaderIDTagName, Value: strconv.Itoa(int(readerID))}
366 > }
367
368 func QueueActionTag(value string) Tag {