diff --git a/src/control/cmd/daos/pretty/selftest.go b/src/control/cmd/daos/pretty/selftest.go index 9a18dc0cb44..bf880dcd0b5 100644 --- a/src/control/cmd/daos/pretty/selftest.go +++ b/src/control/cmd/daos/pretty/selftest.go @@ -55,8 +55,7 @@ func PrintSelfTestResult(out io.Writer, result *daos.SelfTestResult, verbose, sh return errors.Errorf("nil %T", result) } - rpcThroughput := float64(result.MasterLatency.Succeeded()) / result.Duration.Seconds() - + rpcThroughput := result.RPCThroughput() epRanks := ranklist.NewRankSet() epTgts := hostlist.NewNumericSet() for _, ep := range result.TargetEndpoints { @@ -73,7 +72,7 @@ func PrintSelfTestResult(out io.Writer, result *daos.SelfTestResult, verbose, sh } if result.SendSize > 0 || result.ReplySize > 0 { suffix := "B/s" - bw := rpcThroughput * (float64(result.SendSize) + float64(result.ReplySize)) + bw := result.RPCBandwidth() if !showBytes { bw *= 8 suffix = "bps" diff --git a/src/control/cmd/daos/pretty/selftest_test.go b/src/control/cmd/daos/pretty/selftest_test.go index 8ae57f4347a..3bfaacf0dd0 100644 --- a/src/control/cmd/daos/pretty/selftest_test.go +++ b/src/control/cmd/daos/pretty/selftest_test.go @@ -42,8 +42,8 @@ func TestPretty_PrintSelfTestConfig(t *testing.T) { Client/Server Network Test Parameters ------------------------------------- Servers : All - Send RPC Size : 1.00 MiB - Reply RPC Size : 1.00 MiB + Send RPC Size : 1.00 KiB + Reply RPC Size : 1.00 KiB RPCs Per Server: 10000 `, @@ -56,8 +56,8 @@ Client/Server Network Test Parameters Client/Server Network Test Parameters ------------------------------------- Server : 1 - Send RPC Size : 1.00 MiB - Reply RPC Size : 1.00 MiB + Send RPC Size : 1.00 KiB + Reply RPC Size : 1.00 KiB RPCs Per Server: 10000 `, @@ -85,8 +85,8 @@ Client/Server Network Test Parameters Client/Server Network Test Parameters ------------------------------------- Servers : All - Send RPC Size : 1.00 MiB - Reply RPC Size : 1.00 MiB + Send RPC Size : 1.00 KiB + Reply RPC Size : 1.00 KiB RPCs Per Server : 10000 System Name : daos_server Tag : 0 @@ -143,8 +143,8 @@ Client/Server Network Test Parameters Client/Server Network Test Parameters ------------------------------------- Servers : All - Send RPC Size : 1.00 MiB - Reply RPC Size : 1.00 MiB + Send RPC Size : 1.00 KiB + Reply RPC Size : 1.00 KiB RPCs Per Server : 10000 System Name : daos_server Tags : ERROR (0 tags) @@ -169,6 +169,8 @@ Client/Server Network Test Parameters func genResult(xfrm func(result *daos.SelfTestResult)) *daos.SelfTestResult { cfg := &daos.SelfTestConfig{} cfg.SetDefaults() + cfg.SendSizes = []uint64{1 << 20} + cfg.ReplySizes = cfg.SendSizes result := &daos.SelfTestResult{ MasterEndpoint: daos.SelfTestEndpoint{Rank: 3, Tag: 0}, TargetEndpoints: []daos.SelfTestEndpoint{ diff --git a/src/control/lib/daos/selftest.go b/src/control/lib/daos/selftest.go index 703685b5dbe..078a927a897 100644 --- a/src/control/lib/daos/selftest.go +++ b/src/control/lib/daos/selftest.go @@ -76,7 +76,7 @@ type ( var defaultLatencyPercentiles []uint64 = []uint64{50, 75, 90, 95, 99} const ( - defaultSendSize = 1 << 20 // 1MiB + defaultSendSize = 1 << 10 // 1KiB defaultReplySize = defaultSendSize defaultRepCount = 10000 defaultMaxInflight = 16 @@ -297,6 +297,8 @@ func (str *SelfTestResult) MarshalJSON() ([]byte, error) { MasterEndpoint string `json:"master_endpoint"` TargetEndpoints []string `json:"target_endpoints"` EndpointLatencies map[string]*EndpointLatency `json:"target_latencies,omitempty"` + RPCThroughput float64 `json:"rpc_count_per_second"` + RPCBandwidth float64 `json:"rpc_bytes_per_second"` *toJSON }{ MasterEndpoint: str.MasterEndpoint.String(), @@ -308,6 +310,8 @@ func (str *SelfTestResult) MarshalJSON() ([]byte, error) { return eps }(), EndpointLatencies: epLatencies, + RPCThroughput: str.RPCThroughput(), + RPCBandwidth: str.RPCBandwidth(), toJSON: (*toJSON)(str), }) } @@ -352,3 +356,14 @@ func (str *SelfTestResult) TargetRanks() (ranks []ranklist.Rank) { } return } + +// RPCThroughput calculates the number of RPCs per second. +func (str *SelfTestResult) RPCThroughput() float64 { + return float64(str.MasterLatency.Succeeded()) / str.Duration.Seconds() +} + +// RPCBandwidth calculates the bytes per second value based on the number of +// RPCs sent for the duration of the test. +func (str *SelfTestResult) RPCBandwidth() float64 { + return str.RPCThroughput() * (float64(str.SendSize) + float64(str.ReplySize)) +} diff --git a/src/control/lib/daos/selftest_test.go b/src/control/lib/daos/selftest_test.go index 8029a176349..9d36fe36354 100644 --- a/src/control/lib/daos/selftest_test.go +++ b/src/control/lib/daos/selftest_test.go @@ -250,6 +250,8 @@ func TestDaos_SelfTestResult_MarshalJSON(t *testing.T) { "fail_count": 0 } }, + "rpc_count_per_second": 1500, + "rpc_bytes_per_second": 3072000, "repetitions": 3000, "send_size": 1024, "reply_size": 1024,