소스 검색

adding status to processes

steve 8 년 전
부모
커밋
447b0c07df
1개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 18 0
      src/api/index.py

+ 18 - 0
src/api/index.py

@@ -45,6 +45,24 @@ for key in CONFIG :
 	HANDLERS[key] = {"class":ref,"config":CONFIG[key]["config"]}
 
 f.close()
+"""
+	This function determines the status of a given observation as follows
+	considering:
+	x	memory used
+	y	cpu used
+	z	memory allocated
+	
+	x	y	z
+	0	0	0	crash
+	0	0	1	idle
+	1	0	1	idle
+	1	1	1	running
+	
+	This classification is known and we will not write a learner for this. The implementation will account for relationships such as assuming if memory is allocated and cpu is used chances the application is running because there will be memory used otherwise idle
+	
+"""
+
+	
 @app.route('/get/<id>')
 def procs(id):
 	if id in HANDLERS: