| Age | Commit message (Collapse) | Author |
|
|
|
Added test suites:
- types_test.go: Tests for Aggregate, HostAggregate, Epoch, Category, Metric,
OutputFormat, word wrapping, and formatting functions
- report_test.go: Tests for Reporter creation and report generation across
different categories, metrics, and output formats
- aggregate_test.go: Tests for file-based aggregation, context cancellation,
and helper functions
- db_test.go: Tests for database operations including schema creation, imports,
record reset, and aggregate loading
Coverage improved from 17.6% to 82.1%, exceeding the 70% target.
Amp-Thread-ID: https://ampcode.com/threads/T-019c7c73-58f9-7516-958d-f30eb17a3bff
Co-authored-by: Amp <amp@ampcode.com>
|
|
Performance improvement:
- Use transactions for database imports (118x speedup)
- Import time reduced from 11.2s to 0.076s
Amp-Thread-ID: https://ampcode.com/threads/T-019c7c73-58f9-7516-958d-f30eb17a3bff
Co-authored-by: Amp <amp@ampcode.com>
|
|
Previously, ImportFromDir was executing each of 2,587 records as
individual INSERT statements, with each one creating its own transaction.
This was extremely slow at ~11 seconds.
Now wrap all inserts in a single database transaction, which is the
standard approach for bulk data loading. This reduces import time from
11.2s to 0.076s (118x faster).
Verified with:
- Before: real 0m11.193s
- After: real 0m0.076s
Amp-Thread-ID: https://ampcode.com/threads/T-019c7c73-58f9-7516-958d-f30eb17a3bff
Co-authored-by: Amp <amp@ampcode.com>
|
|
Major improvements:
- Apply Go best practices (reorganized types, constructors, methods)
- Remove obsolete files (guprecords.raku, compare-with-raku.sh)
- Extract processRecordsFile helper function
- Fix word-wrapping bug
- Support database import/query workflow
- Add database-backed uprecords Makefile target
Amp-Thread-ID: https://ampcode.com/threads/T-019c7c73-58f9-7516-958d-f30eb17a3bff
Co-authored-by: Amp <amp@ampcode.com>
|
|
- Reorganize types.go: place types and constructors before methods
- Simplify main.go: improve flag handling and reduce code complexity
- Extract processRecordsFile() in aggregate.go: reduce function size, ensure immediate defer
- Change Reporter receivers to value semantics for read-only operations
- Fix wordWrap() function: properly account for line length with leading space
- Remove guprecords.raku: Go implementation is the primary version now
- Remove compare-with-raku.sh: no longer needed
- Update README.md and .gitignore accordingly
All tests pass: go test ./... and ./goprecords test
Amp-Thread-ID: https://ampcode.com/threads/T-019c7c73-58f9-7516-958d-f30eb17a3bff
Co-authored-by: Amp <amp@ampcode.com>
|
|
- cmd/goprecords: CLI with import, query, report-from-files, test
- internal/goprecords: types, order, aggregate, db, report
- internal/version: version constant (0.1.0)
- SQLite import (repeatable: clears record table then inserts)
- Magefile: Build, Test, Install, Uninstall
- Table-driven unit tests; comparison script vs Raku guprecords
- .gitignore: *.db, /goprecords binary
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
|
|
Allow custom section ordering for --all reports while keeping defaults and tests in place.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|