Class: LlmCostTracker::Doctor
- Inherits:
-
Object
- Object
- LlmCostTracker::Doctor
show all
- Defined in:
- lib/llm_cost_tracker/doctor.rb,
lib/llm_cost_tracker/doctor/probe.rb,
lib/llm_cost_tracker/doctor/price_check.rb,
lib/llm_cost_tracker/doctor/schema_check.rb,
lib/llm_cost_tracker/doctor/ingestion_check.rb
Defined Under Namespace
Modules: Probe
Classes: IngestionCheck, PriceCheck, SchemaCheck
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.call ⇒ Object
35
36
37
|
# File 'lib/llm_cost_tracker/doctor.rb', line 35
def call
new.checks
end
|
.healthy?(checks = call) ⇒ Boolean
55
56
57
|
# File 'lib/llm_cost_tracker/doctor.rb', line 55
def healthy?(checks = call)
checks.none? { |check| check.status == :error }
end
|
.report(checks = call, color: $stdout.tty?) ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/llm_cost_tracker/doctor.rb', line 39
def report(checks = call, color: $stdout.tty?)
name_width = checks.map { |c| c.name.length }.max.to_i
lines = [bold("LLM Cost Tracker doctor", color), ""]
each_section(checks) do |section, members|
lines << bold(section, color)
members.each do |check|
status = paint_status("[#{STATUS_GLYPHS.fetch(check.status, check.status)}]", check.status, color)
lines << " #{status} #{"#{check.name}:".ljust(name_width + 1)} #{check.message}"
end
lines << ""
end
lines.pop if lines.last == ""
lines.join("\n")
end
|
Instance Method Details
#checks ⇒ Object
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/llm_cost_tracker/doctor.rb', line 83
def checks
[
configuration_check,
capture_check,
*LlmCostTracker::Integrations.checks,
active_record_check,
table_check,
column_check,
*dependent_core_schema_checks,
call_rollups_check,
IngestionCheck.new.call,
PriceCheck.new.call,
calls_check
].compact
end
|