Skip to content

Instantly share code, notes, and snippets.

@mgwilliams
Created October 14, 2013 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgwilliams/5f25e32c86c7837d9ba1 to your computer and use it in GitHub Desktop.
Save mgwilliams/5f25e32c86c7837d9ba1 to your computer and use it in GitHub Desktop.
- for key, val in saltdata.items():
- # XXX: force datatype, needs typechecks, etc
- try:
- val = float(val)
- metrics.append((metric_base + '.' + key, val, timestamp))
- except TypeError:
- log.info('Error in carbon returner, when trying to convert metric:{0}, with val:{1}'.format(key, val))
+ for name, vals in saltdata.items():
+ for key, val in vals.items():
+ # XXX: force datatype, needs typechecks, etc
+ try:
+ val = float(val)
+ metrics.append((metric_base + '.' + _formatHostname(name) + '.' + key, val, timestamp))
+ except TypeError:
+ log.info('Error in carbon returner, when trying to convert metric:{0}, with val:{1}'.format(key, val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment