database

package
v0.0.0-...-2473a21 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsDatabase

type MetricsDatabase interface {
	SaveProxiedRequestMetric(ctx context.Context, metric *ProxiedRequestMetric) error
	ListProxiedRequestMetricsWithPagination(ctx context.Context, cursor int64, limit int) ([]*ProxiedRequestMetric, int64, error)
	CountAttachedProxiedRequestMetricPartitions(ctx context.Context) (int64, error)
	GetLastCreatedAttachedProxiedRequestMetricsPartitionName(ctx context.Context) (string, error)
	DeleteProxiedRequestMetricsOlderThanNDays(ctx context.Context, n int64) error

	HealthCheck() error
	Partition(prefillPeriodDays int) error
}

MetricsDatabase is an interface for interacting with the database

type ProxiedRequestMetric

type ProxiedRequestMetric struct {
	ID                          int64
	MethodName                  string
	BlockNumber                 *int64
	ResponseLatencyMilliseconds int64
	Hostname                    string
	RequestIP                   string
	RequestTime                 time.Time
	UserAgent                   *string
	Referer                     *string
	Origin                      *string
	ResponseBackend             string
	ResponseBackendRoute        string
	CacheHit                    bool
	PartOfBatch                 bool
}

Directories

Path Synopsis
migrations
when this package is loaded the package directory will be searched for any go or sql migration files and register for them to the proxy service to run https://bun.uptrace.dev/guide/migrations.html#go-based-migrations
when this package is loaded the package directory will be searched for any go or sql migration files and register for them to the proxy service to run https://bun.uptrace.dev/guide/migrations.html#go-based-migrations

Jump to

Keyboard shortcuts

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