@@ -333,21 +333,17 @@ func (e *executor) plan(ctx, killCtx context.Context, env, vars []string, logr l
333333}
334334
335335// Capture the duration of the call to `terraform graph`.
336- graphTimings := newTimingAggregator (database .ProvisionerJobTimingStageGraph )
337- graphTimings .ingest (createGraphTimingsEvent (timingGraphStart ))
338-
336+ endGraph := e .timings .startStage (database .ProvisionerJobTimingStageGraph )
339337state ,plan ,err := e .planResources (ctx ,killCtx ,planfilePath )
338+ endGraph (err )
340339if err != nil {
341- graphTimings .ingest (createGraphTimingsEvent (timingGraphErrored ))
342340return nil ,xerrors .Errorf ("plan resources: %w" ,err )
343341}
344342planJSON ,err := json .Marshal (plan )
345343if err != nil {
346344return nil ,xerrors .Errorf ("marshal plan: %w" ,err )
347345}
348346
349- graphTimings .ingest (createGraphTimingsEvent (timingGraphComplete ))
350-
351347var moduleFiles []byte
352348// Skipping modules archiving is useful if the caller does not need it, eg during
353349// a workspace build. This removes some added costs of sending the modules
@@ -390,7 +386,7 @@ func (e *executor) plan(ctx, killCtx context.Context, env, vars []string, logr l
390386Parameters :state .Parameters ,
391387Resources :state .Resources ,
392388ExternalAuthProviders :state .ExternalAuthProviders ,
393- Timings :append ( e .timings .aggregate (), graphTimings . aggregate () ... ),
389+ Timings :e .timings .aggregate (),
394390Presets :state .Presets ,
395391Plan :planJSON ,
396392ResourceReplacements :resReps ,
@@ -607,10 +603,13 @@ func (e *executor) apply(
607603}
608604
609605// `terraform show` & `terraform graph`
606+ //endGraph := e.timings.startStage(database.ProvisionerJobTimingStageGraph)
610607state ,err := e .stateResources (ctx ,killCtx )
608+ //endGraph(err)
611609if err != nil {
612610return nil ,err
613611}
612+
614613statefilePath := e .files .StateFilePath ()
615614stateContent ,err := os .ReadFile (statefilePath )
616615if err != nil {