def update_metric(name, value, metric_type): sender = HttpApiSender( account_key=settings.VUMI_GO_ACCOUNT_KEY, conversation_key=settings.VUMI_GO_CONVERSATION_KEY, conversation_token=settings.VUMI_GO_ACCOUNT_TOKEN ) sender.fire_metric(name, value, agg=metric_type)
def vumi_fire_metric(metric, value, agg, sender=None): try: if sender is None: sender = HttpApiSender( account_key=settings.VUMI_GO_ACCOUNT_KEY, conversation_key=settings.VUMI_GO_CONVERSATION_KEY, conversation_token=settings.VUMI_GO_ACCOUNT_TOKEN ) sender.fire_metric(metric, value, agg=agg) return sender except SoftTimeLimitExceeded: standard_logger.error( 'Soft time limit exceed processing metric fire to Vumi \ HTTP API via Celery', exc_info=True)