Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions internal/cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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,
Comment thread
isink17 marked this conversation as resolved.
"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,
Expand Down
6 changes: 3 additions & 3 deletions internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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},
Expand Down
1 change: 0 additions & 1 deletion internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
Loading