sciveo 0.0.47__tar.gz → 0.0.48__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.47 → sciveo-0.0.48}/PKG-INFO +1 -1
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/monitoring/monitor.py +16 -9
- sciveo-0.0.48/sciveo/version.py +2 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo.egg-info/PKG-INFO +1 -1
- sciveo-0.0.47/sciveo/version.py +0 -2
- {sciveo-0.0.47 → sciveo-0.0.48}/README.md +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/__init__.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/api/__init__.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/api/base.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/api/upload.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/__init__.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/configuration.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/model.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/sampling.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/tools/hardware.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/tools/logger.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/content/__init__.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/content/dataset.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/content/experiment.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/content/project.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/content/runner.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/setup.cfg +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/setup.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/test/test_configuration.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/test/test_monitoring.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/test/test_runner.py +0 -0
- {sciveo-0.0.47 → sciveo-0.0.48}/test/test_sampling.py +0 -0
|
@@ -42,8 +42,11 @@ class BaseMonitor(DaemonBase):
|
|
|
42
42
|
# Warmup the psutil
|
|
43
43
|
psutil.cpu_percent(interval=0.3, percpu=True)
|
|
44
44
|
initial_cpu_usage = psutil.cpu_percent(interval=None, percpu=True)
|
|
45
|
-
self.
|
|
46
|
-
|
|
45
|
+
self.previous_io_counters = {
|
|
46
|
+
"DISK": psutil.disk_io_counters(perdisk=False),
|
|
47
|
+
"NET": psutil.net_io_counters(pernic=False)
|
|
48
|
+
}
|
|
49
|
+
self.previous_time = {"DISK": time.time(), "NET": time.time()}
|
|
47
50
|
time.sleep(1)
|
|
48
51
|
|
|
49
52
|
machine_serial = self.getserial()
|
|
@@ -137,10 +140,9 @@ class BaseMonitor(DaemonBase):
|
|
|
137
140
|
|
|
138
141
|
def get_disk(self):
|
|
139
142
|
try:
|
|
140
|
-
list_metrics = ["read
|
|
143
|
+
list_metrics = ["read bytes", "write bytes", "read count", "write count", "read time", "write time"]
|
|
141
144
|
disk_io_counters = psutil.disk_io_counters(perdisk=False)
|
|
142
|
-
self.get_io_metrics("DISK", list_metrics, disk_io_counters
|
|
143
|
-
self.previous_disk_io_counters = disk_io_counters
|
|
145
|
+
self.get_io_metrics("DISK", list_metrics, disk_io_counters)
|
|
144
146
|
except Exception as e:
|
|
145
147
|
pass
|
|
146
148
|
|
|
@@ -148,18 +150,23 @@ class BaseMonitor(DaemonBase):
|
|
|
148
150
|
try:
|
|
149
151
|
list_metrics = ["bytes sent", "bytes recv", "packets sent", "packets recv"]
|
|
150
152
|
net_io_counters = psutil.net_io_counters(pernic=False)
|
|
151
|
-
self.get_io_metrics("NET", list_metrics, net_io_counters
|
|
152
|
-
self.previous_net_io_counters = net_io_counters
|
|
153
|
+
self.get_io_metrics("NET", list_metrics, net_io_counters)
|
|
153
154
|
except Exception as e:
|
|
154
155
|
pass
|
|
155
156
|
|
|
156
|
-
def get_io_metrics(self, name, list_metrics, io_counters
|
|
157
|
+
def get_io_metrics(self, name, list_metrics, io_counters):
|
|
157
158
|
counters = io_counters._asdict()
|
|
158
|
-
prev_io_counters =
|
|
159
|
+
prev_io_counters = self.previous_io_counters[name]._asdict()
|
|
160
|
+
time_diff = time.time() - self.previous_time[name]
|
|
159
161
|
for metric_name in list_metrics:
|
|
160
162
|
metric_key = metric_name.replace(' ', '_')
|
|
161
163
|
self.data[name][metric_name] = counters[metric_key] - prev_io_counters[metric_key]
|
|
162
164
|
|
|
165
|
+
if "bytes" in metric_name:
|
|
166
|
+
speed_metric = metric_name.replace("bytes", "speed")
|
|
167
|
+
self.data[name][speed_metric] = self.data[name][metric_name] / time_diff
|
|
168
|
+
self.previous_time[name] = time.time()
|
|
169
|
+
self.previous_io_counters[name] = io_counters
|
|
163
170
|
|
|
164
171
|
if __name__ == "__main__":
|
|
165
172
|
mon = BaseMonitor(period=10)
|
sciveo-0.0.47/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
|