Skip to content

Commit a50fcba

Browse files
committed
add execution_type counter
1 parent 4fb61c8 commit a50fcba

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

localstack-core/localstack/services/stepfunctions/provider.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import time
77
from typing import Final, Optional
88

9+
import localstack.services.stepfunctions.usage as UsageMetrics
910
from localstack.aws.api import CommonServiceException, RequestContext
1011
from localstack.aws.api.stepfunctions import (
1112
ActivityDoesNotExist,
@@ -789,6 +790,10 @@ def start_execution(
789790
state_machine_arn_parts[1] if len(state_machine_arn_parts) == 2 else None
790791
)
791792

793+
# Count metrics about the execution type.
794+
is_mock_test_case: bool = mock_test_case_name is not None
795+
UsageMetrics.execution_type_counter.labels(is_mock_test_case=is_mock_test_case).increment()
796+
792797
store = self.get_store(context=context)
793798

794799
alias: Optional[Alias] = store.aliases.get(state_machine_arn)

localstack-core/localstack/services/stepfunctions/usage.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@
1010
name="language_features_used",
1111
labels=["query_language", "uses_variables"],
1212
)
13+
14+
# Initialize a counter to record the use of each execution type.
15+
execution_type_counter = Counter(
16+
namespace="stepfunctions", name="execution_type", labels=["is_mock_test_case"]
17+
)

0 commit comments

Comments
 (0)