ceremonyclient/bedlam/apps/iotest/main.go
Cassandra Heart dbd95bd9e9
v2.1.0 (#439)
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete

* 2.1.0 main node rollup
2025-09-30 02:48:15 -05:00

57 lines
960 B
Go

//
// main.go
//
// Copyright (c) 2019-2023 Markku Rossi
//
// All rights reserved.
//
package main
import (
"flag"
"log"
"os"
"runtime/pprof"
)
var (
port = ":8080"
)
func main() {
evaluator := flag.Bool("e", false, "evaluator / garbler mode")
cpuprofile := flag.String("cpuprofile", "", "write cpu profile to `file`")
testIO := flag.Int64("test-io", 0, "test I/O performance")
flag.Parse()
log.SetFlags(0)
if len(*cpuprofile) > 0 {
f, err := os.Create(*cpuprofile)
if err != nil {
log.Fatal("could not create CPU profile: ", err)
}
defer f.Close()
if err := pprof.StartCPUProfile(f); err != nil {
log.Fatal("could not start CPU profile: ", err)
}
defer pprof.StopCPUProfile()
}
if *testIO > 0 {
if *evaluator {
err := evaluatorTestIO(*testIO, len(*cpuprofile) > 0)
if err != nil {
log.Fatal(err)
}
} else {
err := garblerTestIO(*testIO)
if err != nil {
log.Fatal(err)
}
}
return
}
}