-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...ory/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_or_update_rule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_repository.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
...adf-bootstrap/deployment/lambda_codebase/pipeline_management/store_pipeline_definition.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
...lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudwatch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
""" | ||
Standardised class for pushing CloudWatch metric data to a service within the ADF Namespace | ||
""" | ||
|
||
import boto3 | ||
|
||
|
||
class ADFMetrics: | ||
def __init__(self, client: boto3.client, service, namespace="ADF") -> None: | ||
""" | ||
Client: Any Boto3 Cloudwatch client | ||
Service: The name of the Service e.g PipelineManagement/Repository or AccountManagement/EnableSupport | ||
namespace: Defaults to ADF | ||
""" | ||
self.cw = client | ||
self.namespace = f"{namespace}/{service}" | ||
|
||
def put_metric_data(self, metric_data): | ||
if type(metric_data) is not list: | ||
if isinstance(metric_data, list): | ||
metric_data = [metric_data] | ||
self.cw.put_metric_data(Namespace=self.namespace, MetricData=metric_data) |