activity.go ×2

Frontier kind: Code frontier

unlabeled · c_ecaaf238a0f2

6 tests · 2416 LOC · 120 files · introduces 0 tests · 36 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges36 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
364 ranges2416 lines · 120 files · Browse complete extent
All tests (intent)
6 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: 36 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/chasm/lib/activity/statemachine.go 22 introduced LOC · 1 range

Open complete file

332 },
333 activitypb.ACTIVITY_EXECUTION_STATUS_CANCELED,
334 > func(a *Activity, ctx chasm.MutableContext, event cancelEvent) error { statemachine.go
335 > return a.StoreOrSelf(ctx).RecordCompleted(ctx, func(ctx chasm.MutableContext) error {
336 > outcome := a.Outcome.Get(ctx)
337 > failure := &failurepb.Failure{
338 > Message: "Activity canceled",
339 > FailureInfo: &failurepb.Failure_CanceledFailureInfo{
340 > CanceledFailureInfo: &failurepb.CanceledFailureInfo{
341 > Details: event.details,
342 > Identity: a.GetCancelState().GetIdentity(),
343 > },
344 > },
345 > }
346 > outcome.Variant = &activitypb.ActivityOutcome_Failed_{
347 > Failed: &activitypb.ActivityOutcome_Failed{
348 > Failure: failure,
349 > },
350 > }
351 >
352 > a.emitOnCanceledMetrics(ctx, event.metricsHandler, event.fromStatus)
353 >
354 > return nil
355 > })
356 },
357 )
go.temporal.io/server/chasm/lib/activity/activity.go 10 introduced LOC · 2 ranges

Open complete file

2011 handler metrics.Handler,
2012 fromStatus activitypb.ActivityExecutionStatus,
2013 > ) { activity.go
2014 > // Record start-to-close latency only while an attempt is running. SCHEDULED (incl. retry
2015 > // backoff) and PAUSED have no running attempt and a possibly-stale StartedTime.
2016 > attemptRunning := fromStatus != activitypb.ACTIVITY_EXECUTION_STATUS_SCHEDULED &&
2017 > fromStatus != activitypb.ACTIVITY_EXECUTION_STATUS_PAUSED
2018 > if attemptRunning {
2019 if startedTime := a.LastAttempt.Get(ctx).GetStartedTime(); startedTime != nil {
2020 metrics.ActivityStartToCloseLatency.With(handler).Record(time.Since(startedTime.AsTime()))
2022 }
2023
2024 > scheduleToCloseLatency := time.Since(a.GetScheduleTime().AsTime()) activity.go
2025 > metrics.ActivityScheduleToCloseLatency.With(handler).Record(scheduleToCloseLatency)
2026 >
2027 > metrics.ActivityCancel.With(handler).Record(1)
2028 }
2029
go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1/activity_state.pb.go 4 introduced LOC · 1 range

Open complete file

413 }
414
415 > func (x *ActivityState) GetCancelState() *ActivityCancelState { activity_state.pb.go
416 > if x != nil {
417 > return x.CancelState
418 > }
419 return nil
420 }