Skip to content

Commit 647a5a4

Browse files
committed
Removed unused code and logic
1 parent 44f7bd9 commit 647a5a4

File tree

2 files changed

+0
-109
lines changed

2 files changed

+0
-109
lines changed

lib/idp_common_pkg/idp_common/agents/error_analyzer/tools/cloudwatch_tool.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import logging
99
import os
10-
from collections import Counter
1110
from datetime import datetime, timedelta
1211
from typing import Any, Dict, List
1312

@@ -16,7 +15,6 @@
1615

1716
from ..config import create_error_response, safe_int_conversion
1817
from .dynamodb_tool import fetch_document_record
19-
from .models import LogEvent
2018
from .xray_tool import extract_lambda_request_ids
2119

2220
logger = logging.getLogger(__name__)
@@ -523,44 +521,6 @@ def _build_response(
523521
return response
524522

525523

526-
# =============================================================================
527-
# PUBLIC UTILITY FUNCTIONS
528-
# =============================================================================
529-
530-
531-
def extract_error_keywords(log_events: List[LogEvent]) -> Dict[str, int]:
532-
"""
533-
Extract and count error keywords from log events.
534-
535-
Args:
536-
log_events: List of LogEvent objects
537-
538-
Returns:
539-
Dict mapping error keywords to their occurrence counts
540-
"""
541-
error_keywords = [
542-
"error",
543-
"exception",
544-
"failed",
545-
"failure",
546-
"timeout",
547-
"fatal",
548-
"critical",
549-
"denied",
550-
"refused",
551-
]
552-
553-
keyword_counts = Counter()
554-
555-
for event in log_events:
556-
message_lower = event.message.lower()
557-
for keyword in error_keywords:
558-
if keyword in message_lower:
559-
keyword_counts[keyword] += 1
560-
561-
return dict(keyword_counts.most_common(10))
562-
563-
564524
# =============================================================================
565525
# PRIVATE HELPER FUNCTIONS
566526
# =============================================================================

lib/idp_common_pkg/idp_common/agents/error_analyzer/tools/models.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)