コード例 #1
0
ファイル: __init__.py プロジェクト: mose/cloudroutes-service
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)
コード例 #2
0
ファイル: __init__.py プロジェクト: tjcunliffe/runbook
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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)