Skip to content

Commit

Permalink
Respect configuration settings for enabled metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
michalgasek committed Mar 18, 2017
1 parent a3d99f8 commit da6d95b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def lambda_handler(event, context):

for datapoint in filtered_datapoints:
timestamp_iso = datapoint['TIMESTAMP_LOWRES_ISO']
if mc.get('RequestCount') is not None:
if mc.get('RequestCount'):
metric_name_suffix = 'RequestCount'
value = 1
cwmb.add_metric_datapoint(
Expand All @@ -252,7 +252,7 @@ def lambda_handler(event, context):
value=value,
)

if (mc.get('TotalRequestTime') is not None and
if (mc.get('TotalRequestTime') and
datapoint['TOTAL_TIME'].isdigit()):
metric_name_suffix = 'TotalRequestTime'
value = int(datapoint['TOTAL_TIME'])
Expand All @@ -265,7 +265,7 @@ def lambda_handler(event, context):
value=value,
)

if (mc.get('TurnAroundTime') is not None and
if (mc.get('TurnAroundTime') and
datapoint['TURN_AROUND_TIME'].isdigit()):
metric_name_suffix = 'TurnAroundTime'
value = int(datapoint['TURN_AROUND_TIME'])
Expand All @@ -278,7 +278,7 @@ def lambda_handler(event, context):
value=value,
)

if (mc.get('ObjectSize') is not None and
if (mc.get('ObjectSize') and
datapoint['OBJECT_SIZE'].isdigit()):
metric_name_suffix = 'ObjectSize'
value = int(datapoint['OBJECT_SIZE'])
Expand Down

0 comments on commit da6d95b

Please sign in to comment.