Skip to content

Commit

Permalink
metric: remove useless TiKVCoprocessorCounter from codebase (pingcap#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany authored and coocood committed May 8, 2018
1 parent 6c94805 commit 33ca87f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
9 changes: 0 additions & 9 deletions metrics/tikvclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@ var (
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20),
}, []string{LblType, "store"})

TiKVCoprocessorCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "tidb",
Subsystem: "tikvclient",
Name: "cop_actions_total",
Help: "Counter of coprocessor actions.",
}, []string{LblType})

TiKVCoprocessorHistogram = prometheus.NewHistogram(
prometheus.HistogramOpts{
Namespace: "tidb",
Expand Down Expand Up @@ -196,7 +188,6 @@ func init() {
prometheus.MustRegister(TiKVBackoffHistogram)
prometheus.MustRegister(TiKVSendReqHistogram)
prometheus.MustRegister(TiKVConnPoolHistogram)
prometheus.MustRegister(TiKVCoprocessorCounter)
prometheus.MustRegister(TiKVCoprocessorHistogram)
prometheus.MustRegister(TiKVLockResolverCounter)
prometheus.MustRegister(TiKVRegionErrorCounter)
Expand Down
8 changes: 0 additions & 8 deletions store/tikv/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ func (c *CopClient) supportExpr(exprType tipb.ExprType) bool {

// Send builds the request and gets the coprocessor iterator response.
func (c *CopClient) Send(ctx context.Context, req *kv.Request, vars *kv.Variables) kv.Response {
metrics.TiKVCoprocessorCounter.WithLabelValues("send").Inc()

bo := NewBackoffer(ctx, copBuildTaskMaxBackoff).WithVars(vars)
tasks, err := buildCopTasks(bo, c.store.regionCache, &copRanges{mid: req.KeyRanges}, req.Desc, req.Streaming)
if err != nil {
Expand Down Expand Up @@ -237,8 +235,6 @@ func (r *copRanges) split(key []byte) (*copRanges, *copRanges) {
}

func buildCopTasks(bo *Backoffer, cache *RegionCache, ranges *copRanges, desc bool, streaming bool) ([]*copTask, error) {
metrics.TiKVCoprocessorCounter.WithLabelValues("build_task").Inc()

start := time.Now()
rangesLen := ranges.len()
cmdType := tikvrpc.CmdCop
Expand Down Expand Up @@ -517,8 +513,6 @@ func (rs *copResultSubset) GetStartKey() kv.Key {
// Next returns next coprocessor result.
// NOTE: Use nil to indicate finish, so if the returned ResultSubset is not nil, reader should continue to call Next().
func (it *copIterator) Next(ctx context.Context) (kv.ResultSubset, error) {
metrics.TiKVCoprocessorCounter.WithLabelValues("next").Inc()

var (
resp copResponse
ok bool
Expand Down Expand Up @@ -621,7 +615,6 @@ func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask, ch
if costTime > minLogCopTaskTime {
worker.logTimeCopTask(costTime, task, bo, resp)
}
metrics.TiKVCoprocessorCounter.WithLabelValues("handle_task").Inc()
metrics.TiKVCoprocessorHistogram.Observe(costTime.Seconds())

if task.cmdType == tikvrpc.CmdCopStream {
Expand Down Expand Up @@ -720,7 +713,6 @@ func (worker *copIteratorWorker) handleCopResponse(bo *Backoffer, resp *coproces
return nil, errors.Trace(err)
}
// We may meet RegionError at the first packet, but not during visiting the stream.
metrics.TiKVCoprocessorCounter.WithLabelValues("rebuild_task").Inc()
return buildCopTasks(bo, worker.store.regionCache, task.ranges, worker.req.Desc, worker.req.Streaming)
}
if lockErr := resp.GetLocked(); lockErr != nil {
Expand Down

0 comments on commit 33ca87f

Please sign in to comment.