summaryrefslogtreecommitdiff
path: root/cmd/anelephantinachinashop/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/anelephantinachinashop/main.go')
-rw-r--r--cmd/anelephantinachinashop/main.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/cmd/anelephantinachinashop/main.go b/cmd/anelephantinachinashop/main.go
new file mode 100644
index 0000000..398b595
--- /dev/null
+++ b/cmd/anelephantinachinashop/main.go
@@ -0,0 +1,41 @@
+package main
+
+import (
+ "flag"
+ "fmt"
+ "log"
+
+ "codeberg.org/snonux/anelephantinachinashop/internal"
+ "codeberg.org/snonux/anelephantinachinashop/internal/config"
+)
+
+func main() {
+ var conf config.Config
+ printVersion := flag.Bool("version", false, "Print version")
+ stressCPU := flag.Bool("cpu", false, "Stress CPU")
+ stressMemory := flag.Bool("memory", false, "Stress memory")
+ stressNetwork := flag.Bool("network", false, "Stress network")
+ flag.Parse()
+
+ if *printVersion {
+ fmt.Println(internal.Version)
+ return
+ }
+
+ if *stressCPU {
+ conf.CPU = config.CPUStressConfig{}
+ }
+ if *stressMemory {
+ conf.Memory = config.MemoryStressConfig{}
+ log.Fatal("Mode not yet implemented")
+ }
+ // TODO: Also add parallel stressers
+ if *stressNetwork {
+ conf.Network = config.NetworkStressConfig{}
+ log.Fatal("Mode not yet implemented")
+ }
+
+ if err := internal.Run(conf); err != nil {
+ log.Fatal(err)
+ }
+}