Skip to content

Commit

Permalink
Add metrics scopes for the archival queue
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden committed Nov 7, 2022
1 parent b300010 commit 40b690a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,11 @@ const (
// DeadlockDetectorScope is a scope for deadlock detector
DeadlockDetectorScope

// PersistenceGetArchivalTaskScope tracks GetArchivalTask calls made by service to persistence layer
PersistenceGetArchivalTaskScope
// PersistenceGetArchivalTasksScope tracks GetArchivalTasks calls made by service to persistence layer
PersistenceGetArchivalTasksScope

NumCommonScopes
)

Expand Down Expand Up @@ -1401,6 +1406,8 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{
PersistenceGetVisibilityTasksScope: {operation: "GetVisibilityTasks"},
PersistenceCompleteVisibilityTaskScope: {operation: "CompleteVisibilityTask"},
PersistenceRangeCompleteVisibilityTasksScope: {operation: "RangeCompleteVisibilityTask"},
PersistenceGetArchivalTaskScope: {operation: "GetArchivalTask"},
PersistenceGetArchivalTasksScope: {operation: "GetArchivalTasks"},
PersistenceGetReplicationTaskScope: {operation: "GetReplicationTask"},
PersistenceGetReplicationTasksScope: {operation: "GetReplicationTasks"},
PersistenceCompleteReplicationTaskScope: {operation: "CompleteReplicationTask"},
Expand Down
4 changes: 4 additions & 0 deletions common/persistence/persistenceMetricClients.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ func (p *executionPersistenceClient) GetHistoryTask(
scopeIdx = metrics.PersistenceGetVisibilityTaskScope
case tasks.CategoryIDReplication:
scopeIdx = metrics.PersistenceGetReplicationTaskScope
case tasks.CategoryIDArchival:
scopeIdx = metrics.PersistenceGetArchivalTaskScope
default:
return nil, serviceerror.NewInternal(fmt.Sprintf("unknown task category type: %v", request.TaskCategory))
}
Expand Down Expand Up @@ -440,6 +442,8 @@ func (p *executionPersistenceClient) GetHistoryTasks(
scopeIdx = metrics.PersistenceGetVisibilityTasksScope
case tasks.CategoryIDReplication:
scopeIdx = metrics.PersistenceGetReplicationTasksScope
case tasks.CategoryIDArchival:
scopeIdx = metrics.PersistenceGetArchivalTasksScope
default:
return nil, serviceerror.NewInternal(fmt.Sprintf("unknown task category type: %v", request.TaskCategory))
}
Expand Down

0 comments on commit 40b690a

Please sign in to comment.