Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -63,23 +63,46 @@ def analyze_awr(content, performance_test_mode, exadata_model, rack_size):
|
|
63 |
if len(cleaned_content) > max_chars:
|
64 |
cleaned_content = cleaned_content[:max_chars] + "\n\n[TRUNCATED]..."
|
65 |
|
66 |
-
|
67 |
-
|
|
|
68 |
|
69 |
-
|
70 |
|
71 |
======== AWR REPORT START ========
|
72 |
{cleaned_content}
|
73 |
======== AWR REPORT END ========
|
74 |
|
75 |
-
Please provide:
|
76 |
-
|
77 |
-
-
|
78 |
-
-
|
79 |
-
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
"""
|
82 |
|
|
|
83 |
# Add Exadata comparison if performance test mode
|
84 |
if performance_test_mode and exadata_model and rack_size:
|
85 |
specs = exadata_specs.get(exadata_model, {}).get(rack_size, {})
|
@@ -108,7 +131,6 @@ Show actual vs theoretical and generate Recommended Next Steps to Bridge Perform
|
|
108 |
return response.choices[0].message.content.strip()
|
109 |
|
110 |
|
111 |
-
|
112 |
# --- Rater ---
|
113 |
def rate_answer_rater(question, final_answer):
|
114 |
prompt = f"Rate this answer 1-5 stars with explanation:\n\n{final_answer}"
|
|
|
63 |
if len(cleaned_content) > max_chars:
|
64 |
cleaned_content = cleaned_content[:max_chars] + "\n\n[TRUNCATED]..."
|
65 |
|
66 |
+
# Build prompt
|
67 |
+
prompt = f"""
|
68 |
+
You are an expert Oracle Database performance analyst with deep knowledge of AWR reports, Oracle RAC internals, and Exadata architecture (Smart Scan, Flash Cache, IORM, RDMA, Storage Indexes).
|
69 |
|
70 |
+
You must produce highly detailed diagnostic insights based on the AWR report provided below. Use numbers and thresholds whenever possible and explain why each observation matters. Do not simply say "high" or "low" — provide the metric, its value, and context (e.g., why 300 gc buffer busy waits/sec is high for OLTP). Explain implications in RAC/Exadata environments.
|
71 |
|
72 |
======== AWR REPORT START ========
|
73 |
{cleaned_content}
|
74 |
======== AWR REPORT END ========
|
75 |
|
76 |
+
Please provide the following sections with as much metric detail and technical context as possible:
|
77 |
+
|
78 |
+
- **Performance Summary**
|
79 |
+
- Overall DB load, CPU usage, and major wait events.
|
80 |
+
- Discuss RAC-specific behaviors such as global cache waits.
|
81 |
+
|
82 |
+
- **Detailed Analysis of Bottlenecks and/or Degradation Risks**
|
83 |
+
- For each identified bottleneck, provide the metric (e.g. "gc buffer busy: 1500/sec") and explain why it is a problem.
|
84 |
+
- Provide RAC-relevant interpretations (e.g. is GC messaging over interconnect too high).
|
85 |
+
- Include flash cache and I/O specific risks.
|
86 |
+
|
87 |
+
- **Performance Forecast and Predictions**
|
88 |
+
- Given the current metrics, predict where the system is heading.
|
89 |
+
- Use thresholds to indicate risk (e.g. "Redo size at 500MB/min approaching flash log limit").
|
90 |
+
|
91 |
+
- **Specific Recommendations for Monitoring**
|
92 |
+
- Suggest exactly which metrics should be tracked and why.
|
93 |
+
- Include SQL_IDs, Global Cache metrics, Log IO, CPU.
|
94 |
+
|
95 |
+
- **Exadata Statistics Performance Summary**
|
96 |
+
- Include IO performance, flash cache hit %, Smart Scan utilization.
|
97 |
+
- Mention storage server level metrics (latency, MB/s, read/write balance).
|
98 |
+
- Indicate if IO saturation occurred based on latency and throughput.
|
99 |
+
|
100 |
+
- **Recommended Next Steps to Bridge Performance Gap**
|
101 |
+
- Generate action plans (e.g. SQL tuning, service affinity, adding storage cells, increasing LOG_BUFFER).
|
102 |
+
- Clearly separate short term vs long term actions.
|
103 |
"""
|
104 |
|
105 |
+
|
106 |
# Add Exadata comparison if performance test mode
|
107 |
if performance_test_mode and exadata_model and rack_size:
|
108 |
specs = exadata_specs.get(exadata_model, {}).get(rack_size, {})
|
|
|
131 |
return response.choices[0].message.content.strip()
|
132 |
|
133 |
|
|
|
134 |
# --- Rater ---
|
135 |
def rate_answer_rater(question, final_answer):
|
136 |
prompt = f"Rate this answer 1-5 stars with explanation:\n\n{final_answer}"
|