Exemplo n.º 1
0
def updateStathat(jdata):
  ''' This method will be called to update a stathat Statistic '''
  ez_key = jdata['time_tracking']['ez_key']
  stat_name = "[%s] End to End Monitor transaction time" % jdata['time_tracking']['env']
  value = time.time() - jdata['time_tracking']['control']
  stathat.ez_value(ez_key, stat_name, value)
  line = "timetracker: Sent stat to StatHat for %s" % jdata['cid']
  syslog.syslog(syslog.LOG_INFO, line)
Exemplo n.º 2
0
def updateStathat(jdata, logger):
    ''' This method will be called to update a stathat Statistic '''
    ez_key = jdata['time_tracking']['ez_key']
    stat_name = "[%s] End to End Monitor transaction time" % jdata[
        'time_tracking']['env']
    value = time.time() - jdata['time_tracking']['control']
    stathat.ez_value(ez_key, stat_name, value)
    line = "timetracker: Sent stat to StatHat for %s" % jdata['cid']
    logger.info(line)
Exemplo n.º 3
0
def callStathat(redata, jdata):
    ''' Actually perform the stathat call '''
    if redata['data']['stat_type'] == "count":
        stathat.ez_count(redata['data']['ez_key'], redata['data']['stat_name'],
                         redata['data']['value'])
        line = "stathat: Sent stathat counter for monitor %s" % jdata['cid']
        syslog.syslog(syslog.LOG_INFO, line)
    elif redata['data']['stat_type'] == "value":
        stathat.ez_value(redata['data']['ez_key'], redata['data']['stat_name'],
                         redata['data']['value'])
        line = "stathat: Sent stathat value for monitor %s" % jdata['cid']
        syslog.syslog(syslog.LOG_INFO, line)
    else:
        line = "stathat: Unknown stat type defined in reaction %s" % redata[
            'id']
        syslog.syslog(syslog.LOG_ERR, line)
Exemplo n.º 4
0
def callStathat(redata, jdata, logger):
    ''' Actually perform the stathat call '''
    if redata['data']['stat_type'] == "count":
        stathat.ez_count(redata['data']['ez_key'], redata['data']['stat_name'],
                         redata['data']['value'])
        line = "stathat: Sent stathat counter for monitor %s" % jdata['cid']
        logger.info(line)
    elif redata['data']['stat_type'] == "value":
        stathat.ez_value(redata['data']['ez_key'], redata['data']['stat_name'],
                         redata['data']['value'])
        line = "stathat: Sent stathat value for monitor %s" % jdata['cid']
        logger.info(line)
    else:
        line = "stathat: Unknown stat type defined in reaction %s" % redata[
            'id']
        logger.error(line)
Exemplo n.º 5
0
def callStathat(redata, jdata):
    ''' Actually perform the stathat call '''
    if redata['data']['stat_type'] == "count":
        stathat.ez_count(
            redata['data']['ez_key'],
            redata['data']['stat_name'], redata['data']['value'])
        line = "stathat: Sent stathat counter for monitor %s" % jdata['cid']
        syslog.syslog(syslog.LOG_INFO, line)
    elif redata['data']['stat_type'] == "value":
        stathat.ez_value(
            redata['data']['ez_key'],
            redata['data']['stat_name'], redata['data']['value'])
        line = "stathat: Sent stathat value for monitor %s" % jdata['cid']
        syslog.syslog(syslog.LOG_INFO, line)
    else:
        line = "stathat: Unknown stat type defined in reaction %s" % redata[
            'id']
        syslog.syslog(syslog.LOG_ERR, line)
Exemplo n.º 6
0
def callStathat(redata, jdata, logger):
    ''' Actually perform the stathat call '''
    if redata['data']['stat_type'] == "count":
        stathat.ez_count(
            redata['data']['ez_key'],
            redata['data']['stat_name'], redata['data']['value'])
        line = "stathat: Sent stathat counter for monitor %s" % jdata['cid']
        logger.info(line)
    elif redata['data']['stat_type'] == "value":
        stathat.ez_value(
            redata['data']['ez_key'],
            redata['data']['stat_name'], redata['data']['value'])
        line = "stathat: Sent stathat value for monitor %s" % jdata['cid']
        logger.info(line)
    else:
        line = "stathat: Unknown stat type defined in reaction %s" % redata[
            'id']
        logger.error(line)