metrics

package
v0.0.0-...-19b0ade Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBackFillerVaaVolumeV3

func RunBackFillerVaaVolumeV3(vaasBsonFile, outputFile, pricesFile, vaaPayloadParserURL, p2pNetwork string)

func RunVaaCount

func RunVaaCount(inputFile, outputFile string)

func RunVaaVolumeFromDb

func RunVaaVolumeFromDb(cfg VaasVolume)

read a csv file with VAAs and convert into a decoded csv file ready to upload to the database

func RunVaaVolumeFromFile

func RunVaaVolumeFromFile(inputFile, outputFile, pricesFile, vaaPayloadParserURL, p2pNetwork string)

read a csv file with VAAs and convert into a decoded csv file ready to upload to the database

Types

type LineParser

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

func NewLineParser

func NewLineParser(converter *VaaConverter) *LineParser

func (*LineParser) ParseLine

func (lp *LineParser) ParseLine(ctx context.Context, line []byte) (string, error)

ParseLine takes a CSV line as input, and generates a line protocol entry as output.

The format for InfluxDB line protocol is: vaa,tags fields timestamp

type VaaConverter

type VaaConverter struct {
	MissingTokens            sync.Map
	MissingTokensCounter     sync.Map
	PriceCache               *prices.CoinPricesCache
	Metrics                  metrics.Metrics
	GetTransferredTokenByVaa token.GetTransferredTokenByVaa
	TokenProvider            *domain.TokenProvider
	zap.Logger
}

func NewVaaConverter

func NewVaaConverter(priceCache *prices.CoinPricesCache,
	GetTransferredTokenByVaa token.GetTransferredTokenByVaa,
	tokenProvider *domain.TokenProvider,
) *VaaConverter

func (*VaaConverter) Convert

func (c *VaaConverter) Convert(ctx context.Context, vaaBytes []byte) (*token.TransferredToken, *write.Point, string, error)

type VaasVolume

type VaasVolume struct {
	DbLayer string //mongo, postgres, both

	// Mongo database configuration
	MongoUri string
	MongoDb  string

	// Postgres database configuration
	DbURL       string
	DbLogEnable bool

	PageSize            int64
	P2PNetwork          string
	OutputFile          string
	PricesFile          string
	VaaPayloadParserUrl string
	StartTime           *time.Time
	EndTime             *time.Time
}

Jump to

Keyboard shortcuts

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