Module: LlmCostTracker::Ingestion
- Defined in:
- lib/llm_cost_tracker/ingestion.rb,
lib/llm_cost_tracker/ingestion/pool.rb,
lib/llm_cost_tracker/ingestion/batch.rb,
lib/llm_cost_tracker/ingestion/inbox.rb,
lib/llm_cost_tracker/ingestion/worker.rb,
lib/llm_cost_tracker/ingestion/lease_claim.rb,
app/models/llm_cost_tracker/ingestion/lease.rb,
app/models/llm_cost_tracker/ingestion/inbox_entry.rb
Defined Under Namespace
Modules: Inbox, Pool, Worker
Classes: Batch, InboxEntry, Lease, LeaseClaim
Constant Summary
collapse
- VERIFY_TAG =
"llm_cost_tracker_verify"
Class Method Summary
collapse
Class Method Details
.cache_rollups? ⇒ Boolean
.ensure_current_schema! ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/llm_cost_tracker/ingestion.rb', line 25
def ensure_current_schema!
unless LlmCostTracker::Call.table_exists?
raise Error, "llm_cost_tracker_calls table is missing; run install generator and migrate"
end
guards_for_current_config.each do |schema_module, table_name|
errors = schema_module.current_schema_errors
next if errors.empty?
raise Error,
"#{table_name} table is not on the current schema: #{errors.join('; ')}; see docs/upgrading.md"
end
end
|
.guards_for_current_config ⇒ Object
.table_name_prefix ⇒ Object
21
22
23
|
# File 'lib/llm_cost_tracker/ingestion.rb', line 21
def table_name_prefix
"llm_cost_tracker_ingestion_"
end
|
.verify ⇒ Object
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/llm_cost_tracker/ingestion.rb', line 54
def verify
unless LlmCostTracker::Call.table_exists?
return [
LlmCostTracker::Check.new(
:error,
"active_record",
"llm_cost_tracker_calls table is missing; run install generator and migrate"
)
]
end
[capture_check]
rescue StandardError => e
[LlmCostTracker::Check.new(:error, "active_record", "#{e.class}: #{e.message}")]
end
|