MCPcopy Create free account
hub / github.com/github/gh-aw / sumAICFromUsageJSONLFiles

Function sumAICFromUsageJSONLFiles

pkg/cli/token_usage.go:611–627  ·  view source on GitHub ↗
(filePaths []string)

Source from the content-addressed store, hash-verified

609}
610
611func sumAICFromUsageJSONLFiles(filePaths []string) (float64, bool, error) {
612 var totalAIC float64
613 found := false
614
615 for _, filePath := range filePaths {
616 fileAIC, fileFound, err := processOneUsageJSONLFile(filePath)
617 if err != nil {
618 return 0, false, err
619 }
620 totalAIC += fileAIC
621 if fileFound {
622 found = true
623 }
624 }
625
626 return totalAIC, found, nil
627}
628
629// processOneUsageJSONLFile reads a single usage JSONL file and returns the total AIC
630// accumulated from its records. The file is deferred-closed immediately after open.

Callers 2

analyzeTokenUsageAICOnlyFunction · 0.70

Calls 1

processOneUsageJSONLFileFunction · 0.85

Tested by 1