Skip to content

Commit

Permalink
schedule: filter by the specific threads
Browse files Browse the repository at this point in the history
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
  • Loading branch information
shafreeck committed Nov 20, 2019
1 parent 16c752a commit 5afb7ba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/cluster_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"time"

"github.com/pingcap/kvproto/pkg/pdpb"
"github.com/pingcap/log"
"github.com/pingcap/pd/pkg/slice"
"github.com/pingcap/pd/server/statistics"
"github.com/pingcap/log"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -94,6 +94,10 @@ func (s LoadState) String() string {
return "none"
}

// ThreadsCollected filters the threads to take into
// the calculation of CPU usage.
var ThreadsCollected = []string{"grpc-server-"}

// NumberOfEntries is the max number of StatEntry that preserved,
// it is the history of a store's hearbeats. The interval of store
// hearbeats from TiKV is 10s, so we can preserve 30 entries per
Expand Down Expand Up @@ -174,7 +178,7 @@ func (cst *ClusterStatEntries) Append(stat *StatEntry) {
cst.stats[storeID] = entries
}

entries.Append(stat)
entries.Append(stat, ThreadsCollected...)
}

func contains(slice []uint64, value uint64) bool {
Expand Down

0 comments on commit 5afb7ba

Please sign in to comment.