def track_validation_stats(json_result, addons_linter=False):
 result = json.loads(json_result)
 result_kind = ('success' if (result['errors'] == 0) else 'failure')
 runner = ('linter' if addons_linter else 'validator')
 statsd.incr('devhub.{}.results.all.{}'.format(runner, result_kind))
 listed_tag = ('listed' if result['metadata']['listed'] else 'unlisted')
 signable_tag = ('is_signable' if addon_can_be_signed(result) else 'is_not_signable')
 statsd.incr('devhub.{}.results.{}.{}'.format(runner, listed_tag, result_kind))
 statsd.incr('devhub.{}.results.{}.{}'.format(runner, listed_tag, signable_tag))

def track_validation_stats ( json_result , addons_linter = False ) : result = json . loads ( json_result ) result_kind = ( 'success' if ( result [ 'errors' ] == 0 ) else 'failure' ) runner = ( 'linter' if addons_linter else 'validator' ) statsd . incr ( 'devhub.{}.results.all.{}' . format ( runner , result_kind ) ) listed_tag = ( 'listed' if result [ 'metadata' ] [ 'listed' ] else 'unlisted' ) signable_tag = ( 'is_signable' if addon_can_be_signed ( result ) else 'is_not_signable' ) statsd . incr ( 'devhub.{}.results.{}.{}' . format ( runner , listed_tag , result_kind ) ) statsd . incr ( 'devhub.{}.results.{}.{}' . format ( runner , listed_tag , signable_tag ) )
given a raw json string of validator results .