Beispiel #1
0
	def test_system(self):
		system_info = runner.system()
		
		cpu = backend.get_collection('cpu')
		cpu.remove()
		
		memory = backend.get_collection('memory')
		memory.remove()
		
		loadavg = backend.get_collection('loadavg')
		loadavg.remove()
		
		disk = backend.get_collection('disk')
		disk.remove()
		
		network = backend.get_collection('network')
		network.remove()
		
		backend.store_entries(system_info)

		eq_(1, cpu.count())
		eq_(1, memory.count())
		eq_(1, loadavg.count())
		eq_(1, disk.count())
		if sys.platform != 'darwin':
			eq_(1, network.count())
Beispiel #2
0
	def test_store_entries(self):
	  db = backend.get_collection('cpu')
	  db.remove()
	  
	  entries_list = {'cpu': {'time': 1313096288, 'idle': 93, 'wait': 0, 'user': 2, 'system': 5}}

	  backend.store_entries(entries_list)


	  total_entries = db.count()
	  eq_(1, total_entries)
Beispiel #3
0
    def test_processes(self):
        process_info = runner.processes()
        process_checks = settings.PROCESS_CHECKS

        for process in process_checks:
            db = backend.get_collection(process)
            db.remove()

        backend.store_entries(process_info)

        for process in process_checks:
            db = backend.get_collection(process)
            eq_(1, db.count())
Beispiel #4
0
	def test_processes(self):
		process_info = runner.processes()
		process_checks = settings.PROCESS_CHECKS
		
		
		for process in process_checks:
			db = backend.get_collection(process)
			db.remove()
		
		backend.store_entries(process_info)

		for process in process_checks:
			db = backend.get_collection(process)
			eq_(1, db.count())
Beispiel #5
0
    def test_store_entries(self):
        db = backend.get_collection('cpu')
        db.remove()

        entries_list = {
            'cpu': {
                'time': 1313096288,
                'idle': 93,
                'wait': 0,
                'user': 2,
                'system': 5
            }
        }

        backend.store_entries(entries_list)

        total_entries = db.count()
        eq_(1, total_entries)