-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial New Client #59
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments
@@ -0,0 +1 @@ | |||
advanced-client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add plan.yaml in here
advanced-client/cmd.go
Outdated
var generateDataOpt = flag.Bool("gen", false, "Pass this flag to generate benchmark data") | ||
var performBenchmarkOpt = flag.Bool("bench", false, "Pass this flag to perform a benchmark") | ||
var performTestOpt = flag.Bool("test", false, "Pass this flag to perform a test") | ||
var interactiveModeOpt = flag.Bool("it", false, "Pass this flag to run in interactive mode") | ||
var singleModeOpt = flag.Bool("single", false, "Pass this flag to run a single command") | ||
var helpOpt = flag.Bool("h", false, "Pass this flag to get help") | ||
var serverHostnameOpt = flag.String("host", "localhost", "Hostname of server for benchmark/test/interactive/single") | ||
var serverPortOpt = flag.Uint("port", 8080, "Port of server for benchmark/test/interactive/single") | ||
var testLevelOpt = flag.Uint("level", 1, "Command complexity level for test (0 -> Only separate specified ; 1 -> Essential ; 2 -> 1 + Dumping ; 3 -> 2 + Delayed ; 4 -> 3 + Heavy Load)") | ||
var commandOpt = flag.String("cmd", "all", "Command to perform in single mode or comma seperated commands for testing") | ||
var testCyclesOpt = flag.Int("c", 10, "Specify how often the test cycle should be performed") | ||
var keyOpt = flag.String("key", "hello", "Key value for single mode") | ||
var valueOpt = flag.String("value", "world", "Value value for single mode") | ||
var durationOpt = flag.Duration("duration", time.Second*10, "Duration for single mode") | ||
var outOpt = flag.String("o", "bench.txt", "Path for output of benchmark/data generation") | ||
var amountOpt = flag.Float64("amount", 0.5, "Amount of data in GB to generate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just comment out all the flags that aren't implemented at the moment. Also, the 'operation' options (like -gen
, -test
, etc.) should be subcommands rather than flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do that, sadly it's not as easy as with Rust's clap, so I would prefer to leave the operation as is. The unimplemented flags will be commented out in the next comment.
advanced-client/cmd.go
Outdated
ret.hostname = *serverHostnameOpt | ||
ret.port = *serverPortOpt | ||
default: | ||
panic("WTF?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this gets called when you pass the -single
flag. It should probably be handled in a separate switch branch.
…-benchmark into 57-new-client
I don't have time to review so much code rn. I'll do it tomorrow and simply test it |
May I add a commit where I rewrote |
You are right, I will change this |
I felt free to implement the changes I would have requested:
I will evaluate the rest of the code some time later. |
This marks the start of implementing a new client.
This pull request doesn't really contain any new value, it will take time until this is finished, but it implements the requested interactive mode.