mirror of https://github.com/etcd-io/dbtester.git
Merge pull request #79 from gyuho/fix
control: upload logs at the end of step2
This commit is contained in:
commit
99d6a5246f
|
|
@ -153,52 +153,6 @@ func generateReport(cfg Config, h []ReqHandler, reqGen func(chan<- request)) {
|
|||
|
||||
close(results)
|
||||
<-pdoneC
|
||||
|
||||
{
|
||||
u, err := remotestorage.NewGoogleCloudStorage([]byte(cfg.GoogleCloudStorageKey), cfg.GoogleCloudProjectName)
|
||||
if err != nil {
|
||||
plog.Fatal(err)
|
||||
}
|
||||
srcCSVResultPath := cfg.ResultPathTimeSeries
|
||||
dstCSVResultPath := filepath.Base(cfg.ResultPathTimeSeries)
|
||||
if !strings.HasPrefix(dstCSVResultPath, cfg.TestName) {
|
||||
dstCSVResultPath = fmt.Sprintf("%s-%s", cfg.TestName, dstCSVResultPath)
|
||||
}
|
||||
dstCSVResultPath = filepath.Join(cfg.GoogleCloudStorageSubDirectory, dstCSVResultPath)
|
||||
|
||||
var uerr error
|
||||
for k := 0; k < 15; k++ {
|
||||
if uerr = u.UploadFile(cfg.GoogleCloudStorageBucketName, srcCSVResultPath, dstCSVResultPath); uerr != nil {
|
||||
plog.Printf("#%d: UploadFile error %v", k, uerr)
|
||||
time.Sleep(2 * time.Second)
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
{
|
||||
u, err := remotestorage.NewGoogleCloudStorage([]byte(cfg.GoogleCloudStorageKey), cfg.GoogleCloudProjectName)
|
||||
if err != nil {
|
||||
plog.Fatal(err)
|
||||
}
|
||||
|
||||
srcCSVResultPath := cfg.ResultPathLog
|
||||
dstCSVResultPath := filepath.Base(cfg.ResultPathLog)
|
||||
if !strings.HasPrefix(dstCSVResultPath, cfg.TestName) {
|
||||
dstCSVResultPath = fmt.Sprintf("%s-%s", cfg.TestName, dstCSVResultPath)
|
||||
}
|
||||
dstCSVResultPath = filepath.Join(cfg.GoogleCloudStorageSubDirectory, dstCSVResultPath)
|
||||
|
||||
var uerr error
|
||||
for k := 0; k < 15; k++ {
|
||||
if uerr = u.UploadFile(cfg.GoogleCloudStorageBucketName, srcCSVResultPath, dstCSVResultPath); uerr != nil {
|
||||
plog.Printf("#%d: UploadFile error %v", k, uerr)
|
||||
time.Sleep(2 * time.Second)
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func step2(cfg Config) error {
|
||||
|
|
@ -352,6 +306,51 @@ func step2(cfg Config) error {
|
|||
generateReport(cfg, h, reqGen)
|
||||
}
|
||||
|
||||
{
|
||||
u, err := remotestorage.NewGoogleCloudStorage([]byte(cfg.GoogleCloudStorageKey), cfg.GoogleCloudProjectName)
|
||||
if err != nil {
|
||||
plog.Fatal(err)
|
||||
}
|
||||
srcCSVResultPath := cfg.ResultPathTimeSeries
|
||||
dstCSVResultPath := filepath.Base(cfg.ResultPathTimeSeries)
|
||||
if !strings.HasPrefix(dstCSVResultPath, cfg.TestName) {
|
||||
dstCSVResultPath = fmt.Sprintf("%s-%s", cfg.TestName, dstCSVResultPath)
|
||||
}
|
||||
dstCSVResultPath = filepath.Join(cfg.GoogleCloudStorageSubDirectory, dstCSVResultPath)
|
||||
|
||||
var uerr error
|
||||
for k := 0; k < 15; k++ {
|
||||
if uerr = u.UploadFile(cfg.GoogleCloudStorageBucketName, srcCSVResultPath, dstCSVResultPath); uerr != nil {
|
||||
plog.Printf("#%d: UploadFile error %v", k, uerr)
|
||||
time.Sleep(2 * time.Second)
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
{
|
||||
u, err := remotestorage.NewGoogleCloudStorage([]byte(cfg.GoogleCloudStorageKey), cfg.GoogleCloudProjectName)
|
||||
if err != nil {
|
||||
plog.Fatal(err)
|
||||
}
|
||||
|
||||
srcCSVResultPath := cfg.ResultPathLog
|
||||
dstCSVResultPath := filepath.Base(cfg.ResultPathLog)
|
||||
if !strings.HasPrefix(dstCSVResultPath, cfg.TestName) {
|
||||
dstCSVResultPath = fmt.Sprintf("%s-%s", cfg.TestName, dstCSVResultPath)
|
||||
}
|
||||
dstCSVResultPath = filepath.Join(cfg.GoogleCloudStorageSubDirectory, dstCSVResultPath)
|
||||
|
||||
var uerr error
|
||||
for k := 0; k < 15; k++ {
|
||||
if uerr = u.UploadFile(cfg.GoogleCloudStorageBucketName, srcCSVResultPath, dstCSVResultPath); uerr != nil {
|
||||
plog.Printf("#%d: UploadFile error %v", k, uerr)
|
||||
time.Sleep(2 * time.Second)
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue