sciveo 0.1.60__tar.gz → 0.1.61__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.60 → sciveo-0.1.61}/PKG-INFO +1 -1
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/cli.py +7 -2
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/monitoring/watchdog/base.py +6 -5
- sciveo-0.1.61/sciveo/monitoring/watchdog/process.py +104 -0
- sciveo-0.1.61/sciveo/version.py +2 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo.egg-info/PKG-INFO +1 -1
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo.egg-info/SOURCES.txt +1 -0
- sciveo-0.1.60/sciveo/version.py +0 -2
- {sciveo-0.1.60 → sciveo-0.1.61}/README.md +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/api/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/api/predictors.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/api/server.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/common/model.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/content/project.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/capture/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/capture/cam.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/capture/nvr.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/encoders/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/encoders/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/encoders/normalizer.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/nlp/search.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/time_series/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/time_series/dataset.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/time_series/predictor.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/time_series/trainer.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/ml/time_series/window_generator.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/job_daemon.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/layouts/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/layouts/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/pipeline.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/postprocessors/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/postprocessors/default.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/aws.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/file/archive.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/album.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/filters.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/generators.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/mask.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/resize.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/media_info.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/qr.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/generators.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/resize.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/queues.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/server.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/web/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/web/server.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/tools/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/tools/video_interactive.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/dataset/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/dataset/object_detection.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/evaluation/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/evaluation/markdown.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/evaluation/object_detection.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/base.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/description.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/embeddings.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/object_detection.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/tools.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/images/transformers.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/nlp/embeddings.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/video/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/ml/video/description.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/monitoring/monitor.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/monitoring/watchdog/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/network/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/network/camera.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/network/sniffer.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/network/tools.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/array.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/aws/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/aws/priority_queue.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/aws/s3.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/common.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/complexity.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/compress.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/configuration.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/crypto.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/daemon.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/draw/__init__.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/draw/contours.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/formating.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/hardware.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/http.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/logger.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/os.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/queue.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/random.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/remote.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/simple_counter.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/synchronized.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo/tools/timers.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/setup.cfg +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/setup.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_complexity.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_compress.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_configuration.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_crypto.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_eval_markdown.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_ml_datasets.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_monitoring.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_runner.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_sampling.py +0 -0
- {sciveo-0.1.60 → sciveo-0.1.61}/test/test_tokenizers.py +0 -0
|
@@ -51,8 +51,9 @@ def main():
|
|
|
51
51
|
parser.add_argument('--src', type=str, default=None, help='Source')
|
|
52
52
|
parser.add_argument('--dst', type=str, default=None, help='Destination')
|
|
53
53
|
parser.add_argument('--value', type=float, help='Value')
|
|
54
|
-
parser.add_argument('--threshold', type=float, help='Threshold')
|
|
54
|
+
parser.add_argument('--threshold', type=float, default=None, help='Threshold')
|
|
55
55
|
parser.add_argument('--execute', type=str, default=None, help='Execute command')
|
|
56
|
+
parser.add_argument('--pid', type=int, default=None, help='Process PID')
|
|
56
57
|
|
|
57
58
|
args = parser.parse_args()
|
|
58
59
|
|
|
@@ -93,13 +94,17 @@ def main():
|
|
|
93
94
|
from sciveo.media.pipelines.processors.audio.audio_extractor_process import plot_audio
|
|
94
95
|
plot_audio(args.width, args.height, args.rate, args.input_path, args.output_path)
|
|
95
96
|
elif args.command == 'watchdog':
|
|
96
|
-
from sciveo.monitoring.watchdog.base import MemoryWatchDogDaemon, DiskWatchDogDaemon
|
|
97
97
|
daemons = []
|
|
98
98
|
if args.execute is not None:
|
|
99
99
|
if args.src is None or args.src.startswith("mem"):
|
|
100
|
+
from sciveo.monitoring.watchdog.base import MemoryWatchDogDaemon
|
|
100
101
|
daemons.append(MemoryWatchDogDaemon(threshold_percent=args.threshold, period=args.period, command=args.execute))
|
|
101
102
|
elif args.src.startswith("disk") and args.input_path is not None:
|
|
103
|
+
from sciveo.monitoring.watchdog.base import DiskWatchDogDaemon
|
|
102
104
|
daemons.append(DiskWatchDogDaemon(path=args.input_path, threshold_percent=args.threshold, period=args.period, command=args.execute))
|
|
105
|
+
elif args.src.startswith("process"):
|
|
106
|
+
from sciveo.monitoring.watchdog.process import ProcessWatchDogDaemon
|
|
107
|
+
daemons.append(ProcessWatchDogDaemon(pid=args.pid, process_cmd=args.dst, period=args.period, command=args.execute, thread_inactive_threshold=args.threshold))
|
|
103
108
|
for daemon in daemons:
|
|
104
109
|
daemon.start()
|
|
105
110
|
while(True):
|
|
@@ -19,23 +19,24 @@ from sciveo.tools.simple_counter import RunCounter
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class BaseWatchDogDaemon(DaemonBase):
|
|
22
|
-
def __init__(self, threshold_percent=90, period=5, command="echo '⚠️'", monitored="none"):
|
|
22
|
+
def __init__(self, threshold_percent=90, period=5, command="echo '⚠️'", monitored="none", monitor_value="usage"):
|
|
23
23
|
super().__init__(period=period)
|
|
24
24
|
self.threshold_percent = threshold_percent
|
|
25
25
|
self.command = command
|
|
26
26
|
self.used_percent = 0
|
|
27
27
|
self.monitored = monitored
|
|
28
|
-
self.
|
|
28
|
+
self.monitor_value = monitor_value
|
|
29
|
+
self.printer = RunCounter(60, lambda: debug(f"{self.monitored} {self.monitor_value}: {self.used_percent}%", f"threshold: {self.threshold_percent}%"))
|
|
29
30
|
|
|
30
|
-
def
|
|
31
|
-
return 0.0
|
|
31
|
+
def value(self):
|
|
32
|
+
return {"percent": 0.0}
|
|
32
33
|
|
|
33
34
|
def loop(self):
|
|
34
35
|
current_value = self.value()
|
|
35
36
|
self.used_percent = current_value["percent"]
|
|
36
37
|
self.printer.run()
|
|
37
38
|
if self.used_percent > self.threshold_percent:
|
|
38
|
-
warning(f"⚠️ {self.monitored}
|
|
39
|
+
warning(f"⚠️ {self.monitored} {self.monitor_value} {self.used_percent}% exceeded {self.threshold_percent}%, executing command: {self.command}")
|
|
39
40
|
subprocess.run(self.command, shell=True)
|
|
40
41
|
|
|
41
42
|
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2025
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
import time
|
|
13
|
+
import psutil
|
|
14
|
+
|
|
15
|
+
from sciveo.tools.logger import *
|
|
16
|
+
from sciveo.monitoring.watchdog.base import BaseWatchDogDaemon
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ProcessWatchDogDaemon(BaseWatchDogDaemon):
|
|
20
|
+
def __init__(self, pid=None, process_cmd=None, period=5, command="echo '⚠️ process error!'", thread_inactive_threshold=None):
|
|
21
|
+
self.process_cmd = process_cmd
|
|
22
|
+
self.threads = {}
|
|
23
|
+
self.thread_inactive_threshold = thread_inactive_threshold
|
|
24
|
+
super().__init__(threshold_percent=10, period=period, command=command, monitored="Process", monitor_value="is dead")
|
|
25
|
+
|
|
26
|
+
self.this_pid = psutil.Process().pid
|
|
27
|
+
self.pids = self.get_pids_by_cmd()
|
|
28
|
+
if pid is not None:
|
|
29
|
+
self.pids.append(pid)
|
|
30
|
+
|
|
31
|
+
def get_pids_by_cmd(self):
|
|
32
|
+
matched_pids = []
|
|
33
|
+
if self.process_cmd is not None:
|
|
34
|
+
for proc in psutil.process_iter(attrs=["pid", "cmdline"]):
|
|
35
|
+
if proc.info["pid"] == self.this_pid:
|
|
36
|
+
continue
|
|
37
|
+
try:
|
|
38
|
+
cmdline = " ".join(proc.info["cmdline"])
|
|
39
|
+
if self.process_cmd in cmdline:
|
|
40
|
+
matched_pids.append(proc.info["pid"])
|
|
41
|
+
except Exception:
|
|
42
|
+
continue
|
|
43
|
+
info(f"processes matching [{self.process_cmd}]", matched_pids)
|
|
44
|
+
return matched_pids
|
|
45
|
+
|
|
46
|
+
def get_threads(self, process):
|
|
47
|
+
current_time = time.time()
|
|
48
|
+
for t in process.threads():
|
|
49
|
+
cpu_time = t.user_time + t.system_time
|
|
50
|
+
if t.id not in self.threads:
|
|
51
|
+
self.threads[t.id] = {
|
|
52
|
+
"id": t.id,
|
|
53
|
+
"start_at": current_time,
|
|
54
|
+
"last_active": current_time,
|
|
55
|
+
"last_cpu": cpu_time
|
|
56
|
+
}
|
|
57
|
+
else:
|
|
58
|
+
if cpu_time != self.threads[t.id]["last_cpu"]:
|
|
59
|
+
self.threads[t.id]["last_active"] = current_time
|
|
60
|
+
self.threads[t.id]["last_cpu"] = cpu_time
|
|
61
|
+
|
|
62
|
+
def check_threads(self, pid):
|
|
63
|
+
current_time = time.time()
|
|
64
|
+
for tid, thr in self.threads.items():
|
|
65
|
+
if current_time - thr["last_active"] > self.thread_inactive_threshold:
|
|
66
|
+
warning(f"⚠️ process[{pid}] thread[{tid}] inactive from {thr['last_active']}")
|
|
67
|
+
|
|
68
|
+
def process_value(self, pid):
|
|
69
|
+
try:
|
|
70
|
+
p = psutil.Process(pid)
|
|
71
|
+
if p.is_running():
|
|
72
|
+
if p.status() != psutil.STATUS_ZOMBIE:
|
|
73
|
+
|
|
74
|
+
if self.thread_inactive_threshold is not None:
|
|
75
|
+
try:
|
|
76
|
+
self.get_threads(p)
|
|
77
|
+
self.check_threads()
|
|
78
|
+
except psutil.NoSuchProcess as e:
|
|
79
|
+
exception(e, pid)
|
|
80
|
+
|
|
81
|
+
return 0
|
|
82
|
+
else:
|
|
83
|
+
return 50
|
|
84
|
+
except psutil.NoSuchProcess:
|
|
85
|
+
pass
|
|
86
|
+
return 100
|
|
87
|
+
|
|
88
|
+
def value(self):
|
|
89
|
+
pv = 0.0
|
|
90
|
+
for pid in self.pids:
|
|
91
|
+
pv += self.process_value(pid)
|
|
92
|
+
return {"percent": pv}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == '__main__':
|
|
96
|
+
daemons = [
|
|
97
|
+
ProcessWatchDogDaemon(pid=87443, thread_inactive_threshold=10),
|
|
98
|
+
ProcessWatchDogDaemon(process_cmd="sciveo monitor", thread_inactive_threshold=10),
|
|
99
|
+
]
|
|
100
|
+
for d in daemons:
|
|
101
|
+
d.start()
|
|
102
|
+
|
|
103
|
+
while(True):
|
|
104
|
+
time.sleep(30)
|
|
@@ -119,6 +119,7 @@ sciveo/monitoring/monitor.py
|
|
|
119
119
|
sciveo/monitoring/start.py
|
|
120
120
|
sciveo/monitoring/watchdog/__init__.py
|
|
121
121
|
sciveo/monitoring/watchdog/base.py
|
|
122
|
+
sciveo/monitoring/watchdog/process.py
|
|
122
123
|
sciveo/network/__init__.py
|
|
123
124
|
sciveo/network/camera.py
|
|
124
125
|
sciveo/network/sniffer.py
|
sciveo-0.1.60/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
|
|
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
|
{sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py
RENAMED
|
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
|
{sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/time_series/__init__.py
RENAMED
|
File without changes
|
{sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/time_series/predictor.py
RENAMED
|
File without changes
|
{sciveo-0.1.60 → sciveo-0.1.61}/sciveo/media/pipelines/processors/sci/time_series/trainer.py
RENAMED
|
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
|
|
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
|
|
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
|