mirror of https://github.com/etcd-io/dbtester.git
control: updates from proto update
This commit is contained in:
parent
b990bf44bd
commit
adaed6d723
|
|
@ -78,24 +78,24 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
gcfg, ok := cfg.DatabaseIDToTestGroup[databaseID]
|
gcfg, ok := cfg.DatabaseIDToConfigClientMachineAgentControl[databaseID]
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("%q is not found", databaseID)
|
return fmt.Errorf("%q is not found", databaseID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if gcfg.BenchmarkSteps.Step2StressDatabase {
|
if gcfg.ConfigClientMachineBenchmarkSteps.Step2StressDatabase {
|
||||||
switch gcfg.BenchmarkOptions.Type {
|
switch gcfg.ConfigClientMachineBenchmarkOptions.Type {
|
||||||
case "write":
|
case "write":
|
||||||
case "read":
|
case "read":
|
||||||
case "read-oneshot":
|
case "read-oneshot":
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("%q is not supported", gcfg.BenchmarkOptions.Type)
|
return fmt.Errorf("%q is not supported", gcfg.ConfigClientMachineBenchmarkOptions.Type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pid := int64(os.Getpid())
|
pid := int64(os.Getpid())
|
||||||
plog.Infof("starting collecting system metrics at %q [disk device: %q | network interface: %q | PID: %d]", cfg.Control.ClientSystemMetricsPath, diskDevice, networkInterface, pid)
|
plog.Infof("starting collecting system metrics at %q [disk device: %q | network interface: %q | PID: %d]", cfg.ConfigClientMachineInitial.ClientSystemMetricsPath, diskDevice, networkInterface, pid)
|
||||||
if err = os.RemoveAll(cfg.Control.ClientSystemMetricsPath); err != nil {
|
if err = os.RemoveAll(cfg.ConfigClientMachineInitial.ClientSystemMetricsPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tcfg := &psn.TopConfig{
|
tcfg := &psn.TopConfig{
|
||||||
|
|
@ -105,7 +105,7 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
var metricsCSV *psn.CSV
|
var metricsCSV *psn.CSV
|
||||||
metricsCSV, err = psn.NewCSV(
|
metricsCSV, err = psn.NewCSV(
|
||||||
cfg.Control.ClientSystemMetricsPath,
|
cfg.ConfigClientMachineInitial.ClientSystemMetricsPath,
|
||||||
pid,
|
pid,
|
||||||
diskDevice,
|
diskDevice,
|
||||||
networkInterface,
|
networkInterface,
|
||||||
|
|
@ -127,7 +127,7 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-donec:
|
case <-donec:
|
||||||
plog.Infof("finishing collecting system metrics; saving CSV at %q", cfg.Control.ClientSystemMetricsPath)
|
plog.Infof("finishing collecting system metrics; saving CSV at %q", cfg.ConfigClientMachineInitial.ClientSystemMetricsPath)
|
||||||
|
|
||||||
if err := metricsCSV.Save(); err != nil {
|
if err := metricsCSV.Save(); err != nil {
|
||||||
plog.Errorf("psn.CSV.Save(%q) error %v", metricsCSV.FilePath, err)
|
plog.Errorf("psn.CSV.Save(%q) error %v", metricsCSV.FilePath, err)
|
||||||
|
|
@ -139,7 +139,7 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
plog.Fatalf("psn.CSV.Interpolate(%q) failed with %v", metricsCSV.FilePath, err)
|
plog.Fatalf("psn.CSV.Interpolate(%q) failed with %v", metricsCSV.FilePath, err)
|
||||||
}
|
}
|
||||||
interpolated.FilePath = cfg.Control.ClientSystemMetricsInterpolatedPath
|
interpolated.FilePath = cfg.ConfigClientMachineInitial.ClientSystemMetricsInterpolatedPath
|
||||||
if err := interpolated.Save(); err != nil {
|
if err := interpolated.Save(); err != nil {
|
||||||
plog.Errorf("psn.CSV.Save(%q) error %v", interpolated.FilePath, err)
|
plog.Errorf("psn.CSV.Save(%q) error %v", interpolated.FilePath, err)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -158,14 +158,14 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
plog.Infof("npt update error: %v", nerr)
|
plog.Infof("npt update error: %v", nerr)
|
||||||
|
|
||||||
println()
|
println()
|
||||||
if gcfg.BenchmarkSteps.Step1StartDatabase {
|
if gcfg.ConfigClientMachineBenchmarkSteps.Step1StartDatabase {
|
||||||
plog.Info("step 1: starting databases...")
|
plog.Info("step 1: starting databases...")
|
||||||
if _, err = cfg.BroadcaseRequest(databaseID, dbtesterpb.Request_Start); err != nil {
|
if _, err = cfg.BroadcaseRequest(databaseID, dbtesterpb.Operation_Start); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if gcfg.BenchmarkSteps.Step2StressDatabase {
|
if gcfg.ConfigClientMachineBenchmarkSteps.Step2StressDatabase {
|
||||||
println()
|
println()
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
println()
|
println()
|
||||||
|
|
@ -175,14 +175,14 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if gcfg.BenchmarkSteps.Step3StopDatabase {
|
if gcfg.ConfigClientMachineBenchmarkSteps.Step3StopDatabase {
|
||||||
println()
|
println()
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
println()
|
println()
|
||||||
plog.Info("step 3: stopping tests...")
|
plog.Info("step 3: stopping tests...")
|
||||||
var idxToResp map[int]dbtesterpb.Response
|
var idxToResp map[int]dbtesterpb.Response
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
idxToResp, err = cfg.BroadcaseRequest(databaseID, dbtesterpb.Request_Stop)
|
idxToResp, err = cfg.BroadcaseRequest(databaseID, dbtesterpb.Operation_Stop)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
plog.Warningf("#%d: STOP failed at %v", i, err)
|
plog.Warningf("#%d: STOP failed at %v", i, err)
|
||||||
time.Sleep(300 * time.Millisecond)
|
time.Sleep(300 * time.Millisecond)
|
||||||
|
|
@ -206,36 +206,36 @@ func commandFunc(cmd *cobra.Command, args []string) error {
|
||||||
close(donec)
|
close(donec)
|
||||||
<-sysdonec
|
<-sysdonec
|
||||||
|
|
||||||
if gcfg.BenchmarkSteps.Step4UploadLogs {
|
if gcfg.ConfigClientMachineBenchmarkSteps.Step4UploadLogs {
|
||||||
println()
|
println()
|
||||||
time.Sleep(3 * time.Second)
|
time.Sleep(3 * time.Second)
|
||||||
println()
|
println()
|
||||||
plog.Info("step 4: uploading logs...")
|
plog.Info("step 4: uploading logs...")
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.LogPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.LogPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientSystemMetricsPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientSystemMetricsPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientSystemMetricsInterpolatedPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientSystemMetricsInterpolatedPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientLatencyThroughputTimeseriesPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientLatencyThroughputTimeseriesPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientLatencyDistributionAllPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientLatencyDistributionAllPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientLatencyDistributionPercentilePath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientLatencyDistributionPercentilePath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientLatencyDistributionSummaryPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientLatencyDistributionSummaryPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ClientLatencyByKeyNumberPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ClientLatencyByKeyNumberPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = cfg.UploadToGoogle(databaseID, cfg.Control.ServerDiskSpaceUsageSummaryPath); err != nil {
|
if err = cfg.UploadToGoogle(databaseID, cfg.ConfigClientMachineInitial.ServerDiskSpaceUsageSummaryPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue