live

package
v1.113.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package live provides live accounting functionality. That is, it keeps track of deltas in the amount of storage used by each project relative to the last tally operation (see satellite/accounting/tally).

Index

Constants

This section is empty.

Variables

View Source
var ErrGetProjectLimitCache = errs.Class("get project limits from cache")

ErrGetProjectLimitCache error for getting project limits from cache.

View Source
var (
	// Error is the default error class for live-accounting.
	Error = errs.Class("live-accounting")
)

Functions

func OpenCache added in v1.26.2

func OpenCache(ctx context.Context, log *zap.Logger, config Config) (accounting.Cache, error)

OpenCache creates a new accounting.Cache instance using the type specified backend in the provided config.

The cache instance may be returned despite of returning the accounting.ErrSystemOrNetError because some backends allows to reconnect on each operation if the connection was not established or it was disconnected, which is what it could happen at the moment to instance it and the cache will work one the backend system will be reachable later on. For this reason, the components that uses the cache should operate despite the backend is not responding successfully although their service is degraded.

Types

type Config

type Config struct {
	StorageBackend     string        `help:"what to use for storing real-time accounting data"`
	BandwidthCacheTTL  time.Duration `default:"5m" help:"bandwidth cache key time to live"`
	AsOfSystemInterval time.Duration `default:"-10s" devDefault:"-1us" testDefault:"-1us" help:"as of system interval"`
	BatchSize          int           `default:"5000" help:"how much projects usage should be requested from redis cache at once"`
}

Config contains configurable values for the live accounting service.

Jump to

Keyboard shortcuts

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