diff --git a/internal/cli/app.go b/internal/cli/app.go index 8cb1a36..6e78e38 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -626,10 +626,12 @@ func runIndex(ctx context.Context, cfg config.Config, stdout io.Writer, cmdName return err } if jsonl { + scanKind := map[bool]string{true: "update", false: "index"}[update] if err := writeJSONL(stdout, map[string]any{ - "type": "scan_summary", - "command": map[bool]string{true: "update", false: "index"}[update], - "data": summary, + "type": "scan_summary", + "command": scanKind, + "scan_kind": scanKind, + "data": summary, }); err != nil { return err } @@ -641,9 +643,9 @@ func runIndex(ctx context.Context, cfg config.Config, stdout io.Writer, cmdName "process_wall_ms": summary.ProcessWallMS, "task_ms": summary.TaskMS, "task_other_ms": summary.TaskOtherMS, + "parse_ms": summary.ParseMS, "read_ms": summary.ReadMS, "hash_ms": summary.HashMS, - "adapter_parse_ms": summary.AdapterParseMS, "write_ms": summary.WriteMS, "write_metadata_ms": summary.WriteMetadataMS, "write_replace_ms": summary.WriteReplaceMS, diff --git a/internal/indexer/indexer.go b/internal/indexer/indexer.go index c026b3d..677eccd 100644 --- a/internal/indexer/indexer.go +++ b/internal/indexer/indexer.go @@ -529,10 +529,10 @@ func (i *Indexer) run(ctx context.Context, opts Options) (store.ScanSummary, err summary.ProcessWallMS = time.Since(processWallStart).Milliseconds() summary.TaskMS = taskDur.Milliseconds() summary.TaskOtherMS = taskOtherDur.Milliseconds() - summary.ParseMS = taskDur.Milliseconds() + // ParseMS is the time spent parsing file content (adapter parse), excluding read/hash/DB writes. + summary.ParseMS = adapterParseDur.Milliseconds() summary.ReadMS = readDur.Milliseconds() summary.HashMS = hashDur.Milliseconds() - summary.AdapterParseMS = adapterParseDur.Milliseconds() summary.WriteMS = writeDur.Milliseconds() summary.WriteMetadataMS = writeMetadataDur.Milliseconds() summary.WriteReplaceMS = writeReplaceDur.Milliseconds() @@ -623,7 +623,7 @@ func (i *Indexer) run(ctx context.Context, opts Options) (store.ScanSummary, err {Phase: "task_other", MS: summary.TaskOtherMS}, {Phase: "read", MS: summary.ReadMS}, {Phase: "hash", MS: summary.HashMS}, - {Phase: "adapter_parse", MS: summary.AdapterParseMS}, + {Phase: "parse", MS: summary.ParseMS}, {Phase: "write", MS: summary.WriteMS}, {Phase: "write_metadata", MS: summary.WriteMetadataMS}, {Phase: "write_replace", MS: summary.WriteReplaceMS}, diff --git a/internal/store/store.go b/internal/store/store.go index a4c6ff9..25eee6e 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -113,7 +113,6 @@ type ScanSummary struct { ParseMS int64 `json:"parse_ms,omitempty"` ReadMS int64 `json:"read_ms,omitempty"` HashMS int64 `json:"hash_ms,omitempty"` - AdapterParseMS int64 `json:"adapter_parse_ms,omitempty"` WriteMS int64 `json:"write_ms,omitempty"` WriteMetadataMS int64 `json:"write_metadata_ms,omitempty"` WriteReplaceMS int64 `json:"write_replace_ms,omitempty"`