Skip to content

Commit ed6b508

Browse files
fix: Use struct field access instead of map indexing
Fix compilation errors in stats.go and ingest_opt.go: - Change map-style indexing (stats["key"]) to struct field access (stats.FieldName) - GetDatabaseStats() returns *metadata.DatabaseStats (struct) - CalculateCompressionStats() returns *storage.DetailedCompressionStats (struct) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent b70c816 commit ed6b508

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

cmd/cimis/ingest_opt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ func cmdIngestOptimized(dataDir, appKey string, args []string) {
9494
fmt.Printf(" Optimized size: %d bytes\n", optSize)
9595
fmt.Printf(" Compressed: %d bytes\n", compressedSize)
9696
fmt.Printf(" Overall ratio: %.2fx\n", float64(originalSize)/float64(compressedSize))
97-
fmt.Printf(" Bytes per record: %.2f\n", stats["bytes_per_record"])
98-
fmt.Printf(" Space savings: %.1f%%\n", stats["space_savings_pct"])
97+
fmt.Printf(" Bytes per record: %.2f\n", stats.BytesPerRecord)
98+
fmt.Printf(" Space savings: %.1f%%\n", stats.SpaceSavingsPct)
9999
fmt.Printf(" Stored in: %s\n", chunkPath)
100100

101101
// Save metadata

cmd/cimis/stats.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ func cmdStats(dataDir string) {
2323

2424
fmt.Println("Database Statistics")
2525
fmt.Println("===================")
26-
fmt.Printf("Stations: %d\n", stats["station_count"])
27-
fmt.Printf("Active stations: %d\n", stats["active_station_count"])
28-
fmt.Printf("Total chunks: %d\n", stats["chunk_count"])
29-
fmt.Printf("Total rows: %d\n", stats["total_rows"])
30-
fmt.Printf("Compressed size: %.2f MB\n", float64(stats["total_compressed_bytes"].(int64))/(1024*1024))
31-
fmt.Printf("Avg compression: %.2fx\n", stats["avg_compression_ratio"])
26+
fmt.Printf("Stations: %d\n", stats.StationCount)
27+
fmt.Printf("Active stations: %d\n", stats.ActiveStationCount)
28+
fmt.Printf("Total chunks: %d\n", stats.ChunkCount)
29+
fmt.Printf("Total rows: %d\n", stats.TotalRows)
30+
fmt.Printf("Compressed size: %.2f MB\n", float64(stats.TotalCompressedBytes)/(1024*1024))
31+
fmt.Printf("Avg compression: %.2fx\n", stats.AvgCompressionRatio)
3232
}

0 commit comments

Comments
 (0)