def print_metric(line, metric, timestamp):
 if (not line['svname']):
  return
 value = line[metric]
 if (not value):
  value = 0
 print ('haproxy.%s %i %s source=%s cluster=%s' % (METRIC_NAMES[metric], timestamp, value, line['svname'], line['pxname']))

def print_metric ( line , metric , timestamp ) : if ( not line [ 'svname' ] ) : return value = line [ metric ] if ( not value ) : value = 0 print ( 'haproxy.%s %i %s source=%s cluster=%s' % ( METRIC_NAMES [ metric ] , timestamp , value , line [ 'svname' ] , line [ 'pxname' ] ) )
print metric to stdout in tcollector format .