anonmetrics

package
v0.167.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MPL-2.0, MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ActiveClientPhrase = "yes i am wanting the activation of the anon metrics client, please thank you lots thank you"
View Source
const ActiveServerPhrase = "" /* 135-byte string literal not displayed */

Variables

This section is empty.

Functions

func MakeMigration

func MakeMigration(d *sql.DB, migrationResource *bindata.AssetSource) (*migrate.Migrate, error)

func NewMigratedDB

func NewMigratedDB(uri string, migrationResource *bindata.AssetSource) (*sql.DB, error)

Types

type Client

type Client struct {
	Config   *ClientConfig
	DB       *appmetrics.Database
	Identity *ecdsa.PrivateKey
	Logger   *zap.Logger

	IntervalInc *FibonacciIntervalIncrementer

	// DBLock prevents deletion of DB items during mainloop
	DBLock sync.Mutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(sender *common.MessageSender) *Client

func (*Client) Start

func (c *Client) Start() error

func (*Client) Stop

func (c *Client) Stop() error

type ClientConfig

type ClientConfig struct {
	ShouldSend  bool
	SendAddress *ecdsa.PublicKey
	Active      string
}

type FibonacciIntervalIncrementer

type FibonacciIntervalIncrementer struct {
	Last    int64
	Current int64
}

func (*FibonacciIntervalIncrementer) Next

type Server

type Server struct {
	Config     *ServerConfig
	Logger     *zap.Logger
	PostgresDB *sql.DB
}

func NewServer

func NewServer(postgresURI string) (*Server, error)

func (*Server) GetAppMetrics

func (s *Server) GetAppMetrics(limit int, offset int) ([]appmetrics.AppMetric, error)

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) StoreMetrics

func (s *Server) StoreMetrics(appMetricsBatch *protobuf.AnonymousMetricBatch) (appMetrics []*appmetrics.AppMetric, err error)

type ServerConfig

type ServerConfig struct {
	Enabled     bool
	PostgresURI string
	Active      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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