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.
Files changed (36) hide show
  1. {sciveo-0.0.30 → sciveo-0.0.31}/PKG-INFO +1 -1
  2. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/__init__.py +9 -0
  3. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/monitoring/monitor.py +11 -4
  4. sciveo-0.0.31/sciveo/version.py +2 -0
  5. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/PKG-INFO +1 -1
  6. sciveo-0.0.30/sciveo/version.py +0 -2
  7. {sciveo-0.0.30 → sciveo-0.0.31}/README.md +0 -0
  8. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/api/__init__.py +0 -0
  9. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/api/base.py +0 -0
  10. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/api/upload.py +0 -0
  11. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/__init__.py +0 -0
  12. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/configuration.py +0 -0
  13. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/model.py +0 -0
  14. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/optimizers.py +0 -0
  15. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/sampling.py +0 -0
  16. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/__init__.py +0 -0
  17. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/daemon.py +0 -0
  18. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/formating.py +0 -0
  19. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/hardware.py +0 -0
  20. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/logger.py +0 -0
  21. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/common/tools/synchronized.py +0 -0
  22. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/__init__.py +0 -0
  23. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/dataset.py +0 -0
  24. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/experiment.py +0 -0
  25. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/project.py +0 -0
  26. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/content/runner.py +0 -0
  27. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo/monitoring/__init__.py +0 -0
  28. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/SOURCES.txt +0 -0
  29. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/dependency_links.txt +0 -0
  30. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/requires.txt +0 -0
  31. {sciveo-0.0.30 → sciveo-0.0.31}/sciveo.egg-info/top_level.txt +0 -0
  32. {sciveo-0.0.30 → sciveo-0.0.31}/setup.cfg +0 -0
  33. {sciveo-0.0.30 → sciveo-0.0.31}/setup.py +0 -0
  34. {sciveo-0.0.30 → sciveo-0.0.31}/test/test_configuration.py +0 -0
  35. {sciveo-0.0.30 → sciveo-0.0.31}/test/test_runner.py +0 -0
  36. {sciveo-0.0.30 → sciveo-0.0.31}/test/test_sampling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.30
3
+ Version: 0.0.31
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
 
@@ -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
- psutil.cpu_percent(interval=0.5)
36
- self.getserial()
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.data["CPU"]["usage_per_core"] = psutil.cpu_percent(interval=None, percpu=True)
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=10)
111
+ mon = BaseMonitor(period=60)
105
112
  mon.start()
106
113
 
107
114
  while(True):
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.0.31'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.30
3
+ Version: 0.0.31
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
 
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.0.30'
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