sciveo 0.1.0__tar.gz → 0.1.1__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 (40) hide show
  1. {sciveo-0.1.0 → sciveo-0.1.1}/PKG-INFO +1 -1
  2. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/monitoring/monitor.py +19 -17
  3. sciveo-0.1.1/sciveo/version.py +2 -0
  4. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo.egg-info/PKG-INFO +1 -1
  5. sciveo-0.1.0/sciveo/version.py +0 -2
  6. {sciveo-0.1.0 → sciveo-0.1.1}/README.md +0 -0
  7. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/__init__.py +0 -0
  8. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/api/__init__.py +0 -0
  9. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/api/base.py +0 -0
  10. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/api/upload.py +0 -0
  11. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/__init__.py +0 -0
  12. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/configuration.py +0 -0
  13. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/model.py +0 -0
  14. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/optimizers.py +0 -0
  15. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/sampling.py +0 -0
  16. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/__init__.py +0 -0
  17. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/daemon.py +0 -0
  18. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/formating.py +0 -0
  19. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/hardware.py +0 -0
  20. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/logger.py +0 -0
  21. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/synchronized.py +0 -0
  22. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/common/tools/timers.py +0 -0
  23. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/content/__init__.py +0 -0
  24. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/content/dataset.py +0 -0
  25. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/content/experiment.py +0 -0
  26. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/content/project.py +0 -0
  27. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/content/runner.py +0 -0
  28. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/monitoring/__init__.py +0 -0
  29. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/monitoring/network.py +0 -0
  30. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo/monitoring/start.py +0 -0
  31. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo.egg-info/SOURCES.txt +0 -0
  32. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo.egg-info/dependency_links.txt +0 -0
  33. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo.egg-info/requires.txt +0 -0
  34. {sciveo-0.1.0 → sciveo-0.1.1}/sciveo.egg-info/top_level.txt +0 -0
  35. {sciveo-0.1.0 → sciveo-0.1.1}/setup.cfg +0 -0
  36. {sciveo-0.1.0 → sciveo-0.1.1}/setup.py +0 -0
  37. {sciveo-0.1.0 → sciveo-0.1.1}/test/test_configuration.py +0 -0
  38. {sciveo-0.1.0 → sciveo-0.1.1}/test/test_monitoring.py +0 -0
  39. {sciveo-0.1.0 → sciveo-0.1.1}/test/test_runner.py +0 -0
  40. {sciveo-0.1.0 → sciveo-0.1.1}/test/test_sampling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -15,6 +15,7 @@ import time
15
15
  import datetime
16
16
  import socket
17
17
  import psutil
18
+ import platform
18
19
  import uuid
19
20
  import numpy as np
20
21
 
@@ -25,6 +26,21 @@ from sciveo.common.tools.formating import format_memory_size
25
26
  from sciveo.api.base import APIRemoteClient
26
27
 
27
28
 
29
+ class MonitorTools:
30
+ @staticmethod
31
+ def serial():
32
+ machine_serial = ""
33
+ s = "-"
34
+ list_uid_calls = [socket.gethostname, psutil.cpu_count, platform.processor]
35
+ for uid_call in list_uid_calls:
36
+ try:
37
+ machine_serial += f"{uid_call()}{s}"
38
+ s = ""
39
+ except Exception:
40
+ pass
41
+ return machine_serial
42
+
43
+
28
44
  class BaseMonitor(DaemonBase):
29
45
  def __init__(self, period=5):
30
46
  super().__init__(period=period)
@@ -50,7 +66,7 @@ class BaseMonitor(DaemonBase):
50
66
  self.previous_time = {"DISK": time.time(), "NET": time.time()}
51
67
  time.sleep(1)
52
68
 
53
- machine_serial = self.getserial()
69
+ machine_serial = MonitorTools.serial()
54
70
 
55
71
  debug(type(self).__name__, f"init monitor with period={period}", machine_serial, "initial_cpu_usage", initial_cpu_usage)
56
72
 
@@ -103,22 +119,6 @@ class BaseMonitor(DaemonBase):
103
119
  except Exception:
104
120
  pass
105
121
 
106
- def getserial(self):
107
- machine_serial = None
108
- try:
109
- machine_serial = f"{socket.gethostname()}-{uuid.getnode()}"
110
- except Exception:
111
- pass
112
- if machine_serial is None:
113
- try:
114
- machine_serial = f"UUID-{uuid.getnode()}"
115
- except Exception:
116
- pass
117
- if machine_serial is None:
118
- machine_serial = f"RND-{random_token(8)}"
119
- self.data["serial"] = machine_serial
120
- return machine_serial
121
-
122
122
  def tail_file(self, file_path, block_size=1024):
123
123
  result = ["EMPTY"]
124
124
  try:
@@ -182,6 +182,8 @@ class BaseMonitor(DaemonBase):
182
182
  self.previous_io_counters[name] = io_counters
183
183
 
184
184
  if __name__ == "__main__":
185
+ print(MonitorTools.serial())
186
+
185
187
  mon = BaseMonitor(period=10)
186
188
  mon.start()
187
189
 
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.1.1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.1.0'
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