7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/fast_exists/intelligence/report/pdf.rb', line 7
def self.render(data, comparison: nil)
lines = []
lines << "% FAST_EXISTS PERFORMANCE & ARCHITECTURE REPORT"
lines << "% Executive Summary"
lines << "% Date: #{data.timestamp}"
lines << ""
lines << "================================================================================"
lines << "OVERALL OPERATIONAL HEALTH: #{data.health[:overall_status].to_s.upcase}"
lines << "ARCHITECTURAL GRADE: #{data.audit[:grade]} (Score: #{data.audit[:audit_score]}/100)"
lines << "QUERIES AVOIDED BY BLOOM FILTERS: #{data.stats[:queries_avoided]}"
lines << "================================================================================"
lines << ""
lines << "1. APPLICATION & ENVIRONMENT"
lines << " - Ruby Version: #{data.environment[:ruby_version]}"
lines << " - Rails Version: #{data.environment[:rails_version]}"
lines << " - DB Adapter: #{data.environment[:database_adapter]}"
lines << " - Backend Storage: #{data.environment[:backend]}"
lines << ""
lines << "2. HEALTH DIAGNOSTICS"
data.health[:checks].each do |c|
lines << " - [#{c[:status].to_s.upcase}] #{c[:name]}: #{c[:message]}"
end
lines << ""
lines << "3. AUDIT & DOCTOR RECOMMENDATIONS"
data.audit[:findings].each do |f|
lines << " * Location: #{f[:location]}"
lines << " Severity: #{f[:severity].to_s.upcase}"
lines << " Problem: #{f[:problem]}"
lines << " Recommendation: #{f[:recommendation]}"
end
lines.join("\n")
end
|