Skip to content

Commit

Permalink
misc flux logging changes
Browse files Browse the repository at this point in the history
IssueID #3694: flux - POST multiple metrics
IssueID #3864: flux - try except everything

- Added metric count in listen.py on POST with mutliple metrics
-
Modified:
skyline/flux/listen.py
skyline/flux/worker.py
  • Loading branch information
earthgecko committed Dec 12, 2020
1 parent 833524a commit 72736f2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
9 changes: 9 additions & 0 deletions skyline/flux/listen.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@ def on_post(self, req, resp):
resp.status = falcon.HTTP_400
return
if metrics:
# added 20201211 - Feature #3694: flux - POST multiple metrics
# Added metric count
if FLUX_VERBOSE_LOGGING:
try:
logger.info('listen :: POST mulitple metric data received with %s entries' % str(len(metrics)))
except:
logger.error(traceback.format_exc())
logger.error('error :: listen :: could not report number of entries submitted in POST mulitple metric data')

for metric_data in metrics:
# Add metric to add to queue
metric = None
Expand Down
24 changes: 15 additions & 9 deletions skyline/flux/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def submit_pickle_data_to_graphite(pickle_data):
submittedToGraphite = True
# modified 20201016 - Feature #3788: snab_flux_load_test
if FLUX_VERBOSE_LOGGING:
logger.info('worker :: sent %s, %s, %s to Graphite' % (str(metric), str(value), str(timestamp)))
logger.info('worker :: sent %s, %s, %s to Graphite - via graphyte' % (str(metric), str(value), str(timestamp)))
metrics_sent_to_graphite += 1
# @added 20200827 - Feature #3708: FLUX_ZERO_FILL_NAMESPACES
metrics_sent.append(metric)
Expand All @@ -586,14 +586,20 @@ def submit_pickle_data_to_graphite(pickle_data):
logger.error('error :: worker :: failed to send metric data to Graphite for %s' % str(metric))
metric = None
if send_to_reciever == 'pickle':
tuple_data = (metric, (int(timestamp), float(value)))
pickle_data.append(tuple_data)
submittedToGraphite = True
metrics_sent_to_graphite += 1
metrics_sent.append(metric)
# @added 202011120 - Feature #3790: flux - pickle to Graphite
# Debug Redis set
metrics_data_sent.append([metric, value, timestamp])
# @modified 20201212 - Task #3864: flux - try except everything
try:
tuple_data = (metric, (int(timestamp), float(value)))
pickle_data.append(tuple_data)
if FLUX_VERBOSE_LOGGING:
logger.info('worker :: sending %s, %s, %s to Graphite - via pickle' % (str(metric), str(value), str(timestamp)))
submittedToGraphite = True
metrics_sent_to_graphite += 1
metrics_sent.append(metric)
# @added 202011120 - Feature #3790: flux - pickle to Graphite
# Debug Redis set
metrics_data_sent.append([metric, value, timestamp])
except Exception as e:
logger.error('error :: worker :: failed to append to pickle_data - %s' % str(e))

if submittedToGraphite:
# Update the metric Redis flux key
Expand Down

0 comments on commit 72736f2

Please sign in to comment.