2855
2856
// CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.
2857
>
func (wh *WorkflowHandler) CountWorkflowExecutions(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (_ *workflowservice.CountWorkflowExecutionsResponse, retError error) {
workflow_handler.go
2858
>
defer log.CapturePanic(wh.logger, &retError)
2859
>
2860
>
if request == nil {
2861
return nil, errRequestNotSet
2862
}
2863
2865
>
namespaceID, err := wh.namespaceRegistry.GetNamespaceID(namespaceName)
2866
>
if err != nil {
2867
return nil, err
2868
}
2869
2871
>
NamespaceID: namespaceID,
2872
>
Namespace: namespaceName,
2873
>
Query: request.GetQuery(),
2874
>
}
2875
>
persistenceResp, err := wh.visibilityMgr.CountWorkflowExecutions(ctx, req)
2876
>
if err != nil {
2877
return nil, err
2878
}
2879
2881
>
Count: persistenceResp.Count,
2882
>
Groups: persistenceResp.Groups,
2883
>
}
2884
>
return resp, nil
2885
}
2886