Beispiel #1
0
def terminate_task(node_id, experiment_id ,service_name, qworker_id, job_id, task_id, start_time):
	elapsed_time = time.time() - start_time
	statsd.gauge(JQUEUER_TASK_ACCOMPLISHED_TIMESTAMP,
		time.time(),
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.histogram(JQUEUER_TASK_RUNNING_TIMESTAMP,
		time.time(),
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_ACCOMPLISHED_DURATION,
		elapsed_time,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_ACCOMPLISHED,
		1,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_RUNNING,
		0,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
Beispiel #2
0
def task_failed(node_id, experiment_id ,service_name, qworker_id, job_id, task_id, fail_time):
	elapsed_time = time.time() - fail_time
	statsd.gauge(JQUEUER_TASK_FAILED_TIMESTAMP,
		time.time(),
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.histogram(JQUEUER_TASK_RUNNING_TIMESTAMP,
		time.time(),
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_FAILED_DURATION,
		elapsed_time,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_FAILED,
		1,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_RUNNING,
		0,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
Beispiel #3
0
def run_task(node_id, experiment_id ,service_name, qworker_id, job_id, task_id):
	statsd.gauge(JQUEUER_TASK_STARTED_TIMESTAMP,
		time.time(),
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.histogram(JQUEUER_TASK_RUNNING_TIMESTAMP,
		time.time(),
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
#			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_RUNNING,
		1,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)
	statsd.gauge(JQUEUER_TASK_STARTED,
		1,
		tags=[
			'node_id:%s' % node_id,
			'experiment_id:%s' % experiment_id,
			'service_name:%s' % service_name,
			'qworker_id: %s' % qworker_id,
			'job_id: %s' % job_id,
			'task_id: %s' % task_id,
		]
	)