MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / displayStats

Method displayStats

cmd/gosqlx/cmd/validator.go:349–364  ·  view source on GitHub ↗

displayStats displays validation statistics

(result *output.ValidationResult)

Source from the content-addressed store, hash-verified

347
348// displayStats displays validation statistics
349func (v *Validator) displayStats(result *output.ValidationResult) {
350 fmt.Fprintf(v.Out, "\n📊 Validation Statistics:\n")
351 fmt.Fprintf(v.Out, " Files processed: %d\n", result.TotalFiles)
352 fmt.Fprintf(v.Out, " Valid files: %d\n", result.ValidFiles)
353 fmt.Fprintf(v.Out, " Invalid files: %d\n", result.InvalidFiles)
354 fmt.Fprintf(v.Out, " Total size: %s\n", formatBytes(result.TotalBytes))
355 fmt.Fprintf(v.Out, " Duration: %v\n", result.Duration)
356
357 if result.TotalFiles > 0 && result.Duration.Seconds() > 0 {
358 fmt.Fprintf(v.Out, " Throughput: %.1f files/sec\n", float64(result.TotalFiles)/result.Duration.Seconds())
359 }
360
361 if result.TotalBytes > 0 && result.Duration.Seconds() > 0 {
362 fmt.Fprintf(v.Out, " Speed: %s/sec\n", formatBytes(int64(float64(result.TotalBytes)/result.Duration.Seconds())))
363 }
364}
365
366// formatBytes formats bytes into human-readable format
367func formatBytes(bytes int64) string {

Callers 2

ValidateMethod · 0.95

Calls 1

formatBytesFunction · 0.85

Tested by 1