sciveo 0.1.0__tar.gz → 0.1.2__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.1.0 → sciveo-0.1.2}/PKG-INFO +1 -1
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/monitoring/monitor.py +20 -18
- sciveo-0.1.2/sciveo/version.py +2 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo.egg-info/PKG-INFO +1 -1
- sciveo-0.1.0/sciveo/version.py +0 -2
- {sciveo-0.1.0 → sciveo-0.1.2}/README.md +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/__init__.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/api/base.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/model.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/hardware.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/logger.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/common/tools/timers.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/content/project.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/monitoring/network.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/setup.cfg +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/setup.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/test/test_configuration.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/test/test_monitoring.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/test/test_runner.py +0 -0
- {sciveo-0.1.0 → sciveo-0.1.2}/test/test_sampling.py +0 -0
|
@@ -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,9 +66,9 @@ class BaseMonitor(DaemonBase):
|
|
|
50
66
|
self.previous_time = {"DISK": time.time(), "NET": time.time()}
|
|
51
67
|
time.sleep(1)
|
|
52
68
|
|
|
53
|
-
|
|
69
|
+
self.data["serial"] = MonitorTools.serial()
|
|
54
70
|
|
|
55
|
-
debug(type(self).__name__, f"init monitor with period={period}",
|
|
71
|
+
debug(type(self).__name__, f"init monitor with period={period}", self.data["serial"], "initial_cpu_usage", initial_cpu_usage)
|
|
56
72
|
|
|
57
73
|
def __call__(self):
|
|
58
74
|
return self.data
|
|
@@ -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
|
|
sciveo-0.1.0/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|