Skip to content

Commit

Permalink
full test1
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <[email protected]>
  • Loading branch information
CabinfeverB committed Sep 15, 2023
1 parent c6610c1 commit de0ebdc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/pd-api-bench/cases/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func newStoreHeartbeat() *storeHeartbeat {
return &storeHeartbeat{
baseCase: &baseCase{
name: "StoreHeartbeat",
qps: 7000,
qps: 100,
burst: 1,
},
}
Expand Down
45 changes: 43 additions & 2 deletions tools/pd-api-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,52 @@ func main() {
}
gcaseStr := strings.Split(*gRPCCases, ",")
for _, str := range gcaseStr {
if len(str) == 0 {
caseQPS := int64(0)
caseBurst := int64(0)
cStr := ""

strs := strings.Split(str, "-")
fmt.Println(strs)
// to get case name
strsa := strings.Split(strs[0], "+")
cStr = strsa[0]
// to get case Burst
if len(strsa) > 1 {
caseBurst, err = strconv.ParseInt(strsa[1], 10, 64)
if err != nil {
log.Printf("parse burst failed for case %s", str)
}
}
// to get case qps
if len(strs) > 1 {
strsb := strings.Split(strs[1], "+")
caseQPS, err = strconv.ParseInt(strsb[0], 10, 64)
if err != nil {
log.Printf("parse qps failed for case %s", str)
}
// to get case Burst
if len(strsb) > 1 {
caseBurst, err = strconv.ParseInt(strsb[1], 10, 64)
if err != nil {
log.Printf("parse burst failed for case %s", str)
}
}
}
if len(cStr) == 0 {
continue
}
if cas, ok := cases.GRPCCaseMap[str]; ok {
if cas, ok := cases.GRPCCaseMap[cStr]; ok {
gcases = append(gcases, cas)
if caseBurst > 0 {
cas.SetBurst(caseBurst)
} else if *burst > 0 {
cas.SetBurst(*burst)
}
if caseQPS > 0 {
cas.SetQPS(caseQPS)
} else if *qps > 0 {
cas.SetQPS(*qps)
}
} else {
log.Println("no this case", str)
}
Expand Down

0 comments on commit de0ebdc

Please sign in to comment.