#!/usr/local/bin/python3.11

import os
import sys
from comet_server import CometServer

def config():
	print('graph_title Comet Job Classification 24h')
	print('graph_args --base 1000 -l 0 ')
	print('graph_category Comet')
	print('other.label Other')
	print('other.draw AREASTACK')
	print('other.min 0')
	print('other.colour dcdcdc')
	print('restore.label Restore')
	print('restore.draw AREASTACK')
	print('restore.min 0')
	print('restore.colour a561d3')
	print('backup.label Backup')
	print('backup.draw AREASTACK')
	print('backup.min 0')
	print('backup.colour 4d98d7')

def main():
	cs = CometServer()
	classificationCount = cs.getJobsClassification()
	print("backup.value " + str(classificationCount["Backup"]))
	print("restore.value " + str(classificationCount["Restore"]))
	print("other.value " + str(classificationCount["Other"]))

if __name__ == '__main__':
	if len(sys.argv) > 1 and sys.argv[1] == 'config':
		config()
	else:
		main()