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

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <[email protected]>

fix lint

Signed-off-by: yisaer <[email protected]>
  • Loading branch information
Yisaer committed Jun 8, 2021
1 parent 1a950ac commit a88ccf0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions testcase/stale-read/bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ pad char(255) not null default '')`

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

// SysbenchCase indicates a sysbench case
type SysbenchCase struct {
insertCount int
rowsEachInsert int
}

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

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

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

// DropTable ...
func (c *SysbenchCase) DropTable(db *sql.DB) error {
_, err := db.Exec("drop table if exists sbtest0")
return err
Expand Down
3 changes: 3 additions & 0 deletions testcase/stale-read/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
"flag"
"time"

// use mysql
_ "github.com/go-sql-driver/mysql"

"github.com/pingcap/tipocket/cmd/util"
logs "github.com/pingcap/tipocket/logsearch/pkg/logs"
"github.com/pingcap/tipocket/pkg/cluster"
Expand Down
5 changes: 4 additions & 1 deletion testcase/stale-read/stale-read.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import (
"go.uber.org/zap"
)

// Config ...
type Config struct {
SysBenchWorkerCount int
SysBenchDuration time.Duration
RowsEachInsert int
InsertCount int
}

// ClientCreator ...
type ClientCreator struct {
Config
}
Expand Down Expand Up @@ -87,7 +89,7 @@ func (c *staleReadClient) SetUp(ctx context.Context, _ []cluster.Node, cnodes []
return nil
}

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

// StoreMetricsValue indicates the metrics value for a store from prometheus
type StoreMetricsValue struct {
Timestamp int64
Value float64
Expand Down

0 comments on commit a88ccf0

Please sign in to comment.