internal

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NUM_EVENTS       = 10000
	BATCH_SIZE       = 100 // Reduced batch size
	REQUESTS_PER_SEC = 50  // Rate limit: requests per second
	MAX_RETRIES      = 1   // Maximum number of retries for failed requests
	INITIAL_BACKOFF  = 100 // Initial backoff in milliseconds
	API_ENDPOINT     = "https://api.cloud.flexprice.io/v1/events"
	TIMEOUT_SECONDS  = 5
)

Variables

This section is empty.

Functions

func AssignTenantToUser

func AssignTenantToUser() error

AssignTenantToUser assigns a tenant to a user

func GenerateNewAPIKey

func GenerateNewAPIKey() error

GenerateNewAPIKey generates a new API key

func MigrateEnvironments

func MigrateEnvironments() error

MigrateEnvironments is the main function that migrates all entities to use environment_id

func OnboardNewTenant

func OnboardNewTenant() error

func SeedEventsClickhouse

func SeedEventsClickhouse() error

SeedEventsClickhouse seeds events data into Clickhouse

func SeedEventsFromMeters

func SeedEventsFromMeters() error

SeedEventsFromMeters seeds events data based on existing meters

func TestKafkaConnection

func TestKafkaConnection(brokers []string, username, password string) error

Types

type BatchResult

type BatchResult struct {
	BatchNumber int
	LastEventID string
	StartTime   time.Time
	EndTime     time.Time
	EventCount  int
}

type EventGenerator

type EventGenerator struct {
	// contains filtered or unexported fields
}

EventGenerator holds the configuration for generating events

func NewEventGenerator

func NewEventGenerator(meters []*meter.Meter, customers []*customer.Customer, logger *logger.Logger) *EventGenerator

NewEventGenerator creates a new event generator with the given meters

type MeterType

type MeterType struct {
	Code        string
	MinValue    int64
	MaxValue    int64
	Description string
}

MeterType represents different types of billable metrics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL