-
Notifications
You must be signed in to change notification settings - Fork 16
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
Main perf tests #2052
Main perf tests #2052
Conversation
- introduce Task interface - remove testing code - use redis connection from pool - unexpose some methods and fields - update running zos node docs & add example for using perf
- use redis pool correctly - add GetAll method - better naming for tasks with prefix `perf.` - use unix date
waiting for |
pkg/graphql/graphql.go
Outdated
@@ -0,0 +1,68 @@ | |||
// Package graphql for grid graphql support | |||
package graphql |
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.
Did we really needed to implement this from scratch ? can't we use an existing graphql client ?
cmds/modules/noded/main.go
Outdated
@@ -202,6 +205,41 @@ func action(cli *cli.Context) error { | |||
return errors.Wrap(err, "failed to create a new perfMon") | |||
} | |||
|
|||
if exists := iperf.Exists(zinit.Default()); exists { |
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.
As discussed before running a tests against public nodes happens from ALL nodes (even the ones without public config). The idea is:
- Public nodes running iperf running in test mode
- All nodes run test against the nodes that has iperf server running
- Nodes measure their up/down speed against the random public nodes.
cmds/modules/noded/main.go
Outdated
g, err := graphql.NewGraphQl(env.GraphQL) | ||
if err != nil { | ||
return errors.Wrap(err, "failed to create a new graphql") | ||
} | ||
|
||
freeFarmNodes, err := g.ListPublicNodes(0, 1, true, false) | ||
if err != nil { | ||
return errors.Wrap(err, "failed to list freefarm nodes from graphql") | ||
} | ||
|
||
nodes, err := g.ListPublicNodes(12, 0, true, false) | ||
if err != nil { | ||
return errors.Wrap(err, "failed to list nodes from graphql") | ||
} | ||
|
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.
This is too much to be done by noded. Noded all what it cares about is to register a certain test against the perf framework.
The test ON RUNNING, will pick the nodes to test against. means the nodes can be different each time the test runs
cmds/modules/noded/main.go
Outdated
perfMon.AddTask(&perf.TCPTask{ | ||
TaskID: "TCPTask", | ||
Schedule: "* */5 * * * *", | ||
ClientIP: strings.SplitN(node.PublicConfig.Ipv4, "/", 2)[0], | ||
Bandwidth: "1M", |
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.
While it's correct, but I really don't like this way to construct types. Instead you should create a NewTest
function that takes no argument (in this case) because all this stuff should be defined by the test itself, and should be modified by the test plugin (for example iperf test has specific fixed id and schedule)
Also we should have one single test for iperf
not 2. It's a single test plugin that will do both tcp and udb (sequentially) and store the result of both tests.
I think a task id can be only iperf
. I don't know why it's called a Task here when it's not
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.
The tests also need to run against MANY nodes per test not a single node. I thought this is clear. so a test can take quite some time before it fiinishes (running multiple tests against multiple nodes for tcp and udp
pkg/perf/tcp_task.go
Outdated
err = cmd.Run() | ||
if err != nil { | ||
log.Error().Err(err).Msgf("failed to run iperf tcp task: %s", stderr.String()) | ||
} | ||
|
||
return out.String(), nil |
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.
This is not a good structure. The data from the output need to be parse and put in a structure that describe both upload and download speeds (decent structure) not just raw output from the command.
The structure should also then have information about what node, what Ip the test was run against, did it work or not, what are the speeds, and any other useful information from the test.
pkg/perf/iperf_task.go
Outdated
|
||
// NewIperfTest creates a new iperf test | ||
func NewIperfTest() IperfTest { | ||
return IperfTest{taskID: "iperf", schedule: "* */5 * * * *"} |
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.
We need to run every 6 hours according to the requirements
Issues
example output
result.txt