sciveo 0.0.30__tar.gz → 0.0.31__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sciveo-0.0.30 → sciveo-0.0.31}/PKG-INFO +1 -1
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/__init__.py +9 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/monitoring/monitor.py +11 -4
- sciveo-0.0.31/sciveo/version.py +2 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/PKG-INFO +1 -1
- sciveo-0.0.30/sciveo/version.py +0 -2
- {sciveo-0.0.30 → sciveo-0.0.31}/README.md +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/api/__init__.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/api/base.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/api/upload.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/__init__.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/configuration.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/model.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/sampling.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/hardware.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/logger.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/__init__.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/dataset.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/experiment.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/project.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/runner.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/setup.cfg +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/setup.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/test/test_configuration.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/test/test_runner.py +0 -0
- {sciveo-0.0.30 → sciveo-0.0.31}/test/test_sampling.py +0 -0
|
@@ -14,11 +14,13 @@ from builtins import ImportError
|
|
|
14
14
|
try:
|
|
15
15
|
|
|
16
16
|
import os
|
|
17
|
+
import time
|
|
17
18
|
|
|
18
19
|
from sciveo.common.tools.logger import *
|
|
19
20
|
from sciveo.common.tools.daemon import TasksDaemon, __upload_content__
|
|
20
21
|
from sciveo.content.runner import ProjectRunner
|
|
21
22
|
from sciveo.content.dataset import Dataset
|
|
23
|
+
from sciveo.monitoring.monitor import BaseMonitor
|
|
22
24
|
from sciveo.version import __version__
|
|
23
25
|
|
|
24
26
|
|
|
@@ -41,5 +43,12 @@ try:
|
|
|
41
43
|
def dataset(info={}):
|
|
42
44
|
return Dataset.get(info)
|
|
43
45
|
|
|
46
|
+
# Monitoring start
|
|
47
|
+
def monitor(period=120):
|
|
48
|
+
mon = BaseMonitor(period=period)
|
|
49
|
+
mon.start()
|
|
50
|
+
while(True):
|
|
51
|
+
time.sleep(60)
|
|
52
|
+
|
|
44
53
|
except ImportError as e:
|
|
45
54
|
pass
|
|
@@ -32,14 +32,17 @@ class BaseMonitor(DaemonBase):
|
|
|
32
32
|
self.data["RAM"] = {
|
|
33
33
|
"installed": self.data["RAM"]
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
self.
|
|
35
|
+
|
|
36
|
+
self.initial_cpu_usage = psutil.cpu_percent(interval=5, percpu=True)
|
|
37
|
+
cpuserial = self.getserial()
|
|
37
38
|
|
|
38
39
|
self.data["logs"] = {}
|
|
39
40
|
self.list_logs = []
|
|
40
41
|
|
|
41
42
|
self.api = APIRemoteClient()
|
|
42
43
|
|
|
44
|
+
debug(type(self).__name__, "init", cpuserial, "initial_cpu_usage", self.initial_cpu_usage)
|
|
45
|
+
|
|
43
46
|
def __call__(self):
|
|
44
47
|
return self.data
|
|
45
48
|
|
|
@@ -59,7 +62,11 @@ class BaseMonitor(DaemonBase):
|
|
|
59
62
|
self.data["logs"][log_name] = self.tail_file(log_path)[-3:]
|
|
60
63
|
|
|
61
64
|
def get_cpu_usage(self):
|
|
62
|
-
self.
|
|
65
|
+
if self.initial_cpu_usage is None:
|
|
66
|
+
self.data["CPU"]["usage_per_core"] = psutil.cpu_percent(interval=None, percpu=True)
|
|
67
|
+
else:
|
|
68
|
+
self.data["CPU"]["usage_per_core"] = self.initial_cpu_usage
|
|
69
|
+
self.initial_cpu_usage = None
|
|
63
70
|
# self.data["CPU"]["usage_per_core"] = (np.array(self.data["CPU"]["usage_per_core"]) / 100.0).tolist()
|
|
64
71
|
self.data["CPU"]["usage"] = np.array(self.data["CPU"]["usage_per_core"]).mean()
|
|
65
72
|
|
|
@@ -101,7 +108,7 @@ class BaseMonitor(DaemonBase):
|
|
|
101
108
|
|
|
102
109
|
|
|
103
110
|
if __name__ == "__main__":
|
|
104
|
-
mon = BaseMonitor(period=
|
|
111
|
+
mon = BaseMonitor(period=60)
|
|
105
112
|
mon.start()
|
|
106
113
|
|
|
107
114
|
while(True):
|
sciveo-0.0.30/sciveo/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|