Skip to content

Commit

Permalink
Use extraction result in StatsWatcher instead of adding new engine
Browse files Browse the repository at this point in the history
  • Loading branch information
epapbak committed Apr 16, 2024
1 parent 2e197df commit 6848e80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 65 deletions.
62 changes: 0 additions & 62 deletions ccx_messaging/engines/ocp_engine.py

This file was deleted.

7 changes: 4 additions & 3 deletions ccx_messaging/watchers/stats_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def __init__(self, prometheus_port=8000):
self._not_handling_total = Counter(
"ccx_not_handled_total",
"Counter of received elements that are not handled by the pipeline",
[ARCHIVE_TYPE_LABEL],
)

self._download_duration = Histogram(
Expand Down Expand Up @@ -119,8 +118,10 @@ def on_extract(self, ctx, broker, extraction):
"""
Fired just after the archive is extracted but before any analysis.
"""
# Update the archive type label's value
self._archive_type = broker.archive_type
# Set archive_type label to hypershift if config/infrastructure.json is found
hcp_config_file = os.path.join(extraction.tmp_dir, "config", "infrastructure.json")
if os.path.exists(hcp_config_file):
self._archive_type = "hypershift"
self._extracted_total.labels(**{ARCHIVE_TYPE_LABEL: self._archive_type}).inc()

def on_download(self, path):
Expand Down

0 comments on commit 6848e80

Please sign in to comment.