LifetimeUsage tracks total cost per user, per project, across all time. Each document represents the cumulative usage for a user-project pair.
| 41 | // LifetimeUsage tracks total cost per user, per project, across all time. |
| 42 | // Each document represents the cumulative usage for a user-project pair. |
| 43 | type LifetimeUsage struct { |
| 44 | ID bson.ObjectID `bson:"_id"` |
| 45 | UserID bson.ObjectID `bson:"user_id"` |
| 46 | ProjectID string `bson:"project_id"` |
| 47 | SuccessCost float64 `bson:"success_cost"` // Total cost in USD for successful requests |
| 48 | FailedCost float64 `bson:"failed_cost"` // Total cost in USD for failed requests |
| 49 | UpdatedAt bson.DateTime `bson:"updated_at"` |
| 50 | } |
| 51 | |
| 52 | func (u LifetimeUsage) CollectionName() string { |
| 53 | return "lifetime_usages" |
nothing calls this directly
no outgoing calls
no test coverage detected