refactor: move all remaining files to orig/ directory
Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
7
orig/tools/performance-audit/go.mod
Normal file
7
orig/tools/performance-audit/go.mod
Normal file
@@ -0,0 +1,7 @@
|
||||
module github.com/fraktal/mev-beta/tools/performance-audit
|
||||
|
||||
go 1.24
|
||||
|
||||
replace github.com/fraktal/mev-beta => ../../
|
||||
|
||||
require github.com/fraktal/mev-beta v0.0.0-00010101000000-000000000000
|
||||
1384
orig/tools/performance-audit/internal/performance_auditor.go
Normal file
1384
orig/tools/performance-audit/internal/performance_auditor.go
Normal file
File diff suppressed because it is too large
Load Diff
69
orig/tools/performance-audit/main.go
Normal file
69
orig/tools/performance-audit/main.go
Normal file
@@ -0,0 +1,69 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/fraktal/mev-beta/tools/performance-audit/internal"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var (
|
||||
testType = flag.String("test", "all", "Test type: throughput, latency, memory, cpu, stress, all")
|
||||
duration = flag.Duration("duration", 5*time.Minute, "Test duration")
|
||||
outputDir = flag.String("output", "reports/performance", "Output directory")
|
||||
verbose = flag.Bool("verbose", false, "Enable verbose output")
|
||||
concurrent = flag.Int("concurrent", 10, "Number of concurrent workers")
|
||||
loadLevel = flag.String("load", "normal", "Load level: light, normal, heavy, extreme")
|
||||
profileEnabled = flag.Bool("profile", false, "Enable CPU/memory profiling")
|
||||
benchmarkMode = flag.Bool("benchmark", false, "Run in benchmark mode")
|
||||
stressTest = flag.Bool("stress", false, "Run stress test scenarios")
|
||||
targetTPS = flag.Int("target-tps", 1000, "Target transactions per second")
|
||||
maxMemoryMB = flag.Int("max-memory", 512, "Maximum memory usage in MB")
|
||||
cpuThreshold = flag.Float64("cpu-threshold", 80.0, "CPU usage threshold percentage")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
// Create output directory
|
||||
if err := os.MkdirAll(*outputDir, 0755); err != nil {
|
||||
log.Fatalf("Failed to create output directory: %v", err)
|
||||
}
|
||||
|
||||
// Initialize performance auditor
|
||||
auditor, err := internal.NewPerformanceAuditor(&internal.PerformanceAuditConfig{
|
||||
TestType: *testType,
|
||||
Duration: *duration,
|
||||
OutputDir: *outputDir,
|
||||
Verbose: *verbose,
|
||||
Concurrent: *concurrent,
|
||||
LoadLevel: *loadLevel,
|
||||
ProfileEnabled: *profileEnabled,
|
||||
BenchmarkMode: *benchmarkMode,
|
||||
StressTest: *stressTest,
|
||||
TargetTPS: *targetTPS,
|
||||
MaxMemoryMB: *maxMemoryMB,
|
||||
CPUThreshold: *cpuThreshold,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to initialize performance auditor: %v", err)
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := context.WithTimeout(ctx, *duration+time.Minute) // Add buffer
|
||||
defer cancel()
|
||||
|
||||
fmt.Printf("Starting performance audit: %s test for %v...\n", *testType, *duration)
|
||||
if err := auditor.RunPerformanceTests(ctx); err != nil {
|
||||
log.Fatalf("Performance audit failed: %v", err)
|
||||
}
|
||||
|
||||
if err := auditor.GenerateReport(); err != nil {
|
||||
log.Fatalf("Report generation failed: %v", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Performance audit complete. Reports saved to: %s\n", *outputDir)
|
||||
}
|
||||
Reference in New Issue
Block a user