Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit a88ccf0

Browse files
committed
fix lint
Signed-off-by: yisaer <[email protected]> fix lint Signed-off-by: yisaer <[email protected]>
1 parent 1a950ac commit a88ccf0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

testcase/stale-read/bench.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ pad char(255) not null default '')`
2121

2222
const splitTableTemplate = `SPLIT TABLE sbtest%d BETWEEN (0) AND (1000000000) REGIONS 100;`
2323

24+
// SysbenchCase indicates a sysbench case
2425
type SysbenchCase struct {
2526
insertCount int
2627
rowsEachInsert int
2728
}
2829

30+
// CreateTable ...
2931
func (c *SysbenchCase) CreateTable(db *sql.DB) error {
3032
if err := c.DropTable(db); err != nil {
3133
log.Error("fail to drop table", zap.Error(err))
@@ -42,6 +44,7 @@ func (c *SysbenchCase) CreateTable(db *sql.DB) error {
4244
return nil
4345
}
4446

47+
// InsertData ...
4548
func (c *SysbenchCase) InsertData(worker *sysbench.Worker, db *sql.DB) error {
4649
var buf bytes.Buffer
4750
pkID := worker.ID
@@ -67,6 +70,7 @@ func (c *SysbenchCase) InsertData(worker *sysbench.Worker, db *sql.DB) error {
6770
return nil
6871
}
6972

73+
// Execute ...
7074
// TODO: fulfill workload in future
7175
func (c *SysbenchCase) Execute(worker *sysbench.Worker, db *sql.DB) error {
7276
log.Info("worker start execute")
@@ -142,6 +146,7 @@ func (c *SysbenchCase) executeSelect(db *sql.DB) error {
142146
return nil
143147
}
144148

149+
// DropTable ...
145150
func (c *SysbenchCase) DropTable(db *sql.DB) error {
146151
_, err := db.Exec("drop table if exists sbtest0")
147152
return err

testcase/stale-read/cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import (
55
"flag"
66
"time"
77

8+
// use mysql
9+
_ "github.com/go-sql-driver/mysql"
10+
811
"github.com/pingcap/tipocket/cmd/util"
912
logs "github.com/pingcap/tipocket/logsearch/pkg/logs"
1013
"github.com/pingcap/tipocket/pkg/cluster"

testcase/stale-read/stale-read.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ import (
1515
"go.uber.org/zap"
1616
)
1717

18+
// Config ...
1819
type Config struct {
1920
SysBenchWorkerCount int
2021
SysBenchDuration time.Duration
2122
RowsEachInsert int
2223
InsertCount int
2324
}
2425

26+
// ClientCreator ...
2527
type ClientCreator struct {
2628
Config
2729
}
@@ -87,7 +89,7 @@ func (c *staleReadClient) SetUp(ctx context.Context, _ []cluster.Node, cnodes []
8789
return nil
8890
}
8991

90-
// SetUp...
92+
// Start ...
9193
func (c *staleReadClient) Start(ctx context.Context, cfg interface{}, cnodes []cluster.ClientNode) error {
9294
log.Info("Run sysbench test")
9395
sysbench.RunTest(c.sysBenchConf)
@@ -134,6 +136,7 @@ func buildPrometheusSvcName(name, namespace string) string {
134136
return fmt.Sprintf("%s-prometheus.%s.svc:9090", name, namespace)
135137
}
136138

139+
// StoreMetricsValue indicates the metrics value for a store from prometheus
137140
type StoreMetricsValue struct {
138141
Timestamp int64
139142
Value float64

0 commit comments

Comments
 (0)