Skip to content

Commit

Permalink
Refactor frontend API handler and use generated code to emit metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll committed Jan 31, 2024
1 parent 856a775 commit 11e23e1
Show file tree
Hide file tree
Showing 11 changed files with 1,709 additions and 827 deletions.
5 changes: 5 additions & 0 deletions common/log/tag/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func WorkflowType(wfType string) Tag {
return newStringTag("wf-type", wfType)
}

// WorkflowSignalName returns tag for WorkflowSignalName
func WorkflowSignalName(signalName string) Tag {
return newStringTag("wf-signal-name", signalName)
}

// WorkflowState returns tag for WorkflowState
func WorkflowState(s int) Tag {
return newInt("wf-state", s)
Expand Down
6 changes: 6 additions & 0 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ const (
FrontendRestartWorkflowExecutionScope = iota + NumAdminScopes
// FrontendStartWorkflowExecutionScope is the metric scope for frontend.StartWorkflowExecution
FrontendStartWorkflowExecutionScope
// FrontendStartWorkflowExecutionAsyncScope is the metric scope for frontend.StartWorkflowExecutionAsync
FrontendStartWorkflowExecutionAsyncScope
// PollForDecisionTaskScope is the metric scope for frontend.PollForDecisionTask
FrontendPollForDecisionTaskScope
// FrontendPollForActivityTaskScope is the metric scope for frontend.PollForActivityTask
Expand Down Expand Up @@ -989,6 +991,8 @@ const (
FrontendResetWorkflowExecutionScope
// FrontendGetSearchAttributesScope is the metric scope for frontend.GetSearchAttributes
FrontendGetSearchAttributesScope
// FrontendGetClusterInfoScope is the metric scope for frontend.GetClusterInfo
FrontendGetClusterInfoScope

NumFrontendScopes
)
Expand Down Expand Up @@ -1734,6 +1738,7 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{

FrontendRestartWorkflowExecutionScope: {operation: "RestartWorkflowExecution"},
FrontendStartWorkflowExecutionScope: {operation: "StartWorkflowExecution"},
FrontendStartWorkflowExecutionAsyncScope: {operation: "StartWorkflowExecutionAsync"},
FrontendPollForDecisionTaskScope: {operation: "PollForDecisionTask"},
FrontendPollForActivityTaskScope: {operation: "PollForActivityTask"},
FrontendRecordActivityTaskHeartbeatScope: {operation: "RecordActivityTaskHeartbeat"},
Expand Down Expand Up @@ -1774,6 +1779,7 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{
FrontendDescribeTaskListScope: {operation: "DescribeTaskList"},
FrontendResetStickyTaskListScope: {operation: "ResetStickyTaskList"},
FrontendGetSearchAttributesScope: {operation: "GetSearchAttributes"},
FrontendGetClusterInfoScope: {operation: "GetClusterInfo"},
},
// History Scope Names
History: {
Expand Down
8 changes: 8 additions & 0 deletions common/types/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,14 @@ func (v *ListTaskListPartitionsRequest) GetDomain() (o string) {
return
}

// GetTaskList is an internal getter (TBD...)
func (v *ListTaskListPartitionsRequest) GetTaskList() (o *TaskList) {
if v != nil && v.TaskList != nil {
return v.TaskList
}
return
}

// ListTaskListPartitionsResponse is an internal type (TBD...)
type ListTaskListPartitionsResponse struct {
ActivityTaskListPartitions []*TaskListPartitionMetadata `json:"activityTaskListPartitions,omitempty"`
Expand Down
Loading

0 comments on commit 11e23e1

Please sign in to comment.