Documentation
¶
Overview ¶
Package usage reports what a tenant consumed per calendar month (UTC). It shows quantities; prices come later.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Units = map[string]string{
"video_minutes_encoded": "minutes",
"video_minutes_stored": "minutes",
"video_delivery_bytes": "bytes",
"video_delivery_requests": "requests",
}
Units is each meter's unit. An application built on ulka-vms adds its own meters at start.
var Used = map[string]func(ctx context.Context, q core.TenantTx) (float64, error){ "encode_minutes": func(ctx context.Context, q core.TenantTx) (float64, error) { return video.MinutesCommitted(ctx, q, pgtype.UUID{}) }, }
Used counts what a workspace has of something its limits cap, by the name /v1/limits shows it under. An application built on ulka-vms adds its own at start.
Functions ¶
func PeriodicJobs ¶
func PeriodicJobs() []*river.PeriodicJob
Types ¶
type LogMeterArgs ¶
type LogMeterArgs struct{}
LogMeterArgs copies video delivered from the origin, counted from its access logs in ClickHouse, into each tenant's usage records.
func (LogMeterArgs) InsertOpts ¶
func (LogMeterArgs) InsertOpts() river.InsertOpts
func (LogMeterArgs) Kind ¶
func (LogMeterArgs) Kind() string
type StorageMeterArgs ¶
type StorageMeterArgs struct{}
StorageMeterArgs records each tenant's stored video minutes for the current hour. Each hour's record is minutes ÷ hours in the month, so a month's total is the average minutes stored across it. ponytail: an hour no run lands in isn't billed; deleted videos leave no history to recompute it from.
func (StorageMeterArgs) InsertOpts ¶
func (StorageMeterArgs) InsertOpts() river.InsertOpts
func (StorageMeterArgs) Kind ¶
func (StorageMeterArgs) Kind() string