Class: Tracebook::RollupDaily
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Tracebook::RollupDaily
- Defined in:
- app/models/tracebook/rollup_daily.rb
Overview
Daily aggregated metrics for LLM interactions.
Stores summarized statistics by date/provider/model/project for analytics and cost reporting. Updated nightly by DailyRollupsJob.
Fields
date- Date of rollup (part of composite PK)provider- Provider name (part of composite PK)model- Model identifier (part of composite PK)project- Project name (part of composite PK, nullable)interactions_count- Total number of interactionssuccess_count- Number of successful interactionserror_count- Number of failed interactionsinput_tokens_sum- Sum of input tokensoutput_tokens_sum- Sum of output tokenscost_cents_sum- Total cost in cents
Primary Key
Composite PK: (date, provider, model, project)
Instance Attribute Summary collapse
-
#cost_cents_sum ⇒ Integer
Total cost in cents (default: 0).
-
#error_count ⇒ Integer
Number of failed interactions (default: 0).
-
#input_tokens_sum ⇒ Integer
Sum of input tokens across all interactions (default: 0).
-
#interactions_count ⇒ Integer
Total number of interactions (default: 0).
-
#output_tokens_sum ⇒ Integer
Sum of output tokens across all interactions (default: 0).
-
#success_count ⇒ Integer
Number of successful interactions (default: 0).
Instance Attribute Details
#cost_cents_sum ⇒ Integer
Returns Total cost in cents (default: 0).
67 |
# File 'app/models/tracebook/rollup_daily.rb', line 67 attribute :cost_cents_sum, :integer, default: 0 |
#error_count ⇒ Integer
Returns Number of failed interactions (default: 0).
55 |
# File 'app/models/tracebook/rollup_daily.rb', line 55 attribute :error_count, :integer, default: 0 |
#input_tokens_sum ⇒ Integer
Returns Sum of input tokens across all interactions (default: 0).
59 |
# File 'app/models/tracebook/rollup_daily.rb', line 59 attribute :input_tokens_sum, :integer, default: 0 |
#interactions_count ⇒ Integer
Returns Total number of interactions (default: 0).
47 |
# File 'app/models/tracebook/rollup_daily.rb', line 47 attribute :interactions_count, :integer, default: 0 |
#output_tokens_sum ⇒ Integer
Returns Sum of output tokens across all interactions (default: 0).
63 |
# File 'app/models/tracebook/rollup_daily.rb', line 63 attribute :output_tokens_sum, :integer, default: 0 |
#success_count ⇒ Integer
Returns Number of successful interactions (default: 0).
51 |
# File 'app/models/tracebook/rollup_daily.rb', line 51 attribute :success_count, :integer, default: 0 |