Skip to content

Commit

Permalink
Add metrics scopes for the archival queue (#3566)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden authored Dec 8, 2022
1 parent d112ea8 commit bece27d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/metrics/metric_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,14 @@ const (
PersistenceRangeCompleteVisibilityTasksScope = "RangeCompleteVisibilityTasks"
// PersistenceGetReplicationTaskScope tracks GetReplicationTask calls made by service to persistence layer
PersistenceGetReplicationTaskScope = "GetReplicationTask"
// PersistenceGetArchivalTaskScope tracks GetArchivalTask calls made by service to persistence layer
PersistenceGetArchivalTaskScope = "GetArchivalTask"
// PersistenceGetArchivalTasksScope tracks GetArchivalTasks calls made by service to persistence layer
PersistenceGetArchivalTasksScope = "GetArchivalTasks"
// PersistenceCompleteArchivalTaskScope tracks CompleteArchivalTasks calls made by service to persistence layer
PersistenceCompleteArchivalTaskScope = "CompleteArchivalTask"
// PersistenceRangeCompleteArchivalTasksScope tracks CompleteArchivalTasks calls made by service to persistence layer
PersistenceRangeCompleteArchivalTasksScope = "RangeCompleteArchivalTasks"
// PersistenceGetReplicationTasksScope tracks GetReplicationTasks calls made by service to persistence layer
PersistenceGetReplicationTasksScope = "GetReplicationTasks"
// PersistenceCompleteReplicationTaskScope tracks CompleteReplicationTasks calls made by service to persistence layer
Expand Down
8 changes: 8 additions & 0 deletions common/persistence/persistenceMetricClients.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ func (p *executionPersistenceClient) GetHistoryTask(
operation = metrics.PersistenceGetVisibilityTaskScope
case tasks.CategoryIDReplication:
operation = metrics.PersistenceGetReplicationTaskScope
case tasks.CategoryIDArchival:
operation = metrics.PersistenceGetArchivalTaskScope
default:
return nil, serviceerror.NewInternal(fmt.Sprintf("unknown task category type: %v", request.TaskCategory))
}
Expand All @@ -357,6 +359,8 @@ func (p *executionPersistenceClient) GetHistoryTasks(
operation = metrics.PersistenceGetVisibilityTasksScope
case tasks.CategoryIDReplication:
operation = metrics.PersistenceGetReplicationTasksScope
case tasks.CategoryIDArchival:
operation = metrics.PersistenceGetArchivalTasksScope
default:
return nil, serviceerror.NewInternal(fmt.Sprintf("unknown task category type: %v", request.TaskCategory))
}
Expand All @@ -383,6 +387,8 @@ func (p *executionPersistenceClient) CompleteHistoryTask(
operation = metrics.PersistenceCompleteVisibilityTaskScope
case tasks.CategoryIDReplication:
operation = metrics.PersistenceCompleteReplicationTaskScope
case tasks.CategoryIDArchival:
operation = metrics.PersistenceCompleteArchivalTaskScope
default:
return serviceerror.NewInternal(fmt.Sprintf("unknown task category type: %v", request.TaskCategory))
}
Expand All @@ -409,6 +415,8 @@ func (p *executionPersistenceClient) RangeCompleteHistoryTasks(
operation = metrics.PersistenceRangeCompleteVisibilityTasksScope
case tasks.CategoryIDReplication:
operation = metrics.PersistenceRangeCompleteReplicationTasksScope
case tasks.CategoryIDArchival:
operation = metrics.PersistenceRangeCompleteArchivalTasksScope
default:
return serviceerror.NewInternal(fmt.Sprintf("unknown task category type: %v", request.TaskCategory))
}
Expand Down

0 comments on commit bece27d

Please sign in to comment.