Skip to content

Commit

Permalink
Remove shard id metrics tags
Browse files Browse the repository at this point in the history
  • Loading branch information
madhuravi committed Jun 20, 2017
1 parent ff5debc commit 8d81d42
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ This doc is intended for contributors to `cadence` server (hopefully that's you!
## Development Environment

* Go. Install on OS X with `brew install go`.
* `thrift`. Install on OS X with `brew install thrift`)
* `thrift`. Install on OS X with `brew install thrift`
* `thrift-gen`. Install with `go get github.com/uber/tchannel-go/thrift/thrift-gen`

Note: `thrift` should be >= 0.10.0. Run `brew upgrade thrift` if you're on an older version.

## Checking out the code

Make sure the repository is cloned to the correct location:
Expand Down Expand Up @@ -41,7 +43,7 @@ commit messages. Read it, follow it, learn it, love it.

## Building

You can compile the `cadence` service and helper tools without running test:
You can compile the `cadence` service and helper tools without running test:

```bash
make bins
Expand All @@ -57,7 +59,7 @@ brew install cassandra

# start cassandra
/usr/local/bin/cassandra
```
```

Run all the tests:

Expand Down
3 changes: 0 additions & 3 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ const (
const (
HostnameTagName = "hostname"
OperationTagName = "operation"
// ShardTagName is temporary until we can get all metric data removed for the service
ShardTagName = "shard"
)

// This package should hold all the metrics and tags for cadence
const (
UnknownDirectoryTagValue = "Unknown"
AllShardsTagValue = "ALL"
)

// Common service base metrics
Expand Down
9 changes: 1 addition & 8 deletions service/history/execMgrFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,5 @@ func (factory *executionMgrFactory) CreateExecutionManager(shardID int) (persist
shardID,
factory.logger)

if err != nil {
return nil, err
}

tags := map[string]string{
metrics.ShardTagName: metrics.AllShardsTagValue,
}
return persistence.NewWorkflowExecutionPersistenceClient(mgr, factory.metricsClient.Tagged(tags)), nil
return persistence.NewWorkflowExecutionPersistenceClient(mgr, factory.metricsClient), err
}
7 changes: 2 additions & 5 deletions service/history/shardContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func (s *shardContextImpl) allocateTimerIDsLocked(timerTasks []persistence.Task)
// TODO: This method has too many parameters. Clean it up. Maybe create a struct to pass in as parameter.
func acquireShard(shardID int, shardManager persistence.ShardManager, historyMgr persistence.HistoryManager,
executionMgr persistence.ExecutionManager, owner string, closeCh chan<- int, logger bark.Logger,
reporter metrics.Client) (ShardContext, error) {
metricsClient metrics.Client) (ShardContext, error) {
response, err0 := shardManager.GetShard(&persistence.GetShardRequest{ShardID: shardID})
if err0 != nil {
return nil, err0
Expand All @@ -444,14 +444,11 @@ func acquireShard(shardID int, shardManager persistence.ShardManager, historyMgr
shardInfo: updatedShardInfo,
rangeSize: defaultRangeSize,
closeCh: closeCh,
metricsClient: metricsClient,
}
context.logger = logger.WithFields(bark.Fields{
logging.TagHistoryShardID: shardID,
})
tags := map[string]string{
metrics.ShardTagName: metrics.AllShardsTagValue,
}
context.metricsClient = reporter.Tagged(tags)

err1 := context.renewRangeLocked(true)
if err1 != nil {
Expand Down

0 comments on commit 8d81d42

Please sign in to comment.