tpsmon

package
v0.0.0-...-914b871 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AwsMetricsEnabledFlag = cli.BoolFlag{
		Name:  "awsmetrics",
		Usage: `AWS metrics enabled`,
	}

	AwsRegionFlag = cli.StringFlag{
		Name:  "awsregion",
		Usage: `AWS region`,
	}

	AwsNwNameFlag = cli.StringFlag{
		Name:  "awsnetwork",
		Usage: `AWS network name`,
	}

	AwsInstanceFlag = cli.StringFlag{
		Name:  "awsinst",
		Usage: `AWS instance name`,
	}

	InfluxdbEnabledFlag = cli.BoolFlag{
		Name:  "influxdb",
		Usage: `Influxdb enabled`,
	}

	InfluxdbEndpointFlag = cli.StringFlag{
		Name:  "influxdb.endpoint",
		Usage: `Influxdb endpoint`,
		Value: "http://localhost:8086",
	}

	InfluxdbTokenFlag = cli.StringFlag{
		Name:  "influxdb.token",
		Usage: `Influxdb token or username:password`,
		Value: ":",
	}
	InfluxdbOrgFlag = cli.StringFlag{
		Name:  "influxdb.org",
		Usage: `Influxdb org name`,
		Value: "",
	}
	InfluxdbBucketFlag = cli.StringFlag{
		Name:  "influxdb.bucket",
		Usage: `Influxdb bucket or database name`,
		Value: "telegraf",
	}
	InfluxdbPointNameFlag = cli.StringFlag{
		Name:  "influxdb.measurement",
		Usage: `Influxdb measurement name`,
		Value: "quorum_tps",
	}
	InfluxdbTagsFlag = cli.StringFlag{
		Name:  "influxdb.tags",
		Usage: `Influxdb tags (comma separated list of key=value pairs)`,
		Value: "system=quorum,comp=tps",
	}
	ConsensusFlag = cli.StringFlag{
		Name:  "consensus",
		Usage: `Name of consensus ("raft", "ibft")`,
	}

	DebugFlag = cli.BoolFlag{
		Name:  "debug",
		Usage: `Debug mode`,
	}

	HttpEndpointFlag = cli.StringFlag{
		Name:  "httpendpoint",
		Usage: "Geth's http endpoint",
	}

	ReportFileFlag = cli.StringFlag{
		Name:  "report",
		Usage: "Full path of csv report file",
		Value: "tps-report.csv",
	}

	TpsPortFlag = cli.IntFlag{
		Name:  "port",
		Usage: "Http port for tps monitor",
		Value: 7575,
	}

	FromBlockFlag = cli.Uint64Flag{
		Name:  "from",
		Usage: "From block no",
		Value: 0,
	}

	ToBlockFlag = cli.Uint64Flag{
		Name:  "to",
		Usage: "To block no",
		Value: 0,
	}

	PrometheusPortFlag = cli.IntFlag{
		Name:  "prometheusport",
		Usage: "Enable prometheus metrics",
		Value: 0,
	}
)

Functions

This section is empty.

Types

type AwsCloudwatchService

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

wrapper for aws cloudwatch to publish metrics

func NewCloudwatchService

func NewCloudwatchService(region string, nwname string, inst string) *AwsCloudwatchService

func (*AwsCloudwatchService) PutMetrics

func (a *AwsCloudwatchService) PutMetrics(mname string, value string, ts time.Time) error

type InfluxdbMetricsService

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

func NewInfluxdbService

func NewInfluxdbService(ep string, token string, org string, bucket string, point string, tags string) (*InfluxdbMetricsService, error)

func (*InfluxdbMetricsService) PushMetrics

func (id *InfluxdbMetricsService) PushMetrics(tm time.Time, tps uint64, txns uint64, blocks uint64)

type PrometheusMetricsService

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

func NewPrometheusMetricsService

func NewPrometheusMetricsService(port int) *PrometheusMetricsService

func (*PrometheusMetricsService) Start

func (ps *PrometheusMetricsService) Start()

type TPSMonitor

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

TPSMonitor implements a monitor service

func NewTPSMonitor

func NewTPSMonitor(awsService *AwsCloudwatchService, promethService *PrometheusMetricsService, influxdbService *InfluxdbMetricsService, isRaft bool, report string, frmBlk uint64, toBlk uint64, httpendpoint string) *TPSMonitor

func (*TPSMonitor) IfBlockRangeGiven

func (tm *TPSMonitor) IfBlockRangeGiven() bool

func (*TPSMonitor) StartTpsForBlockRange

func (tm *TPSMonitor) StartTpsForBlockRange()

func (*TPSMonitor) StartTpsForNewBlocksFromChain

func (tm *TPSMonitor) StartTpsForNewBlocksFromChain()

starts service to calculate tps

func (*TPSMonitor) Stop

func (tm *TPSMonitor) Stop()

stops service

func (*TPSMonitor) Wait

func (tm *TPSMonitor) Wait()

waits for stop signal to end service

type TPSRecord

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

TPSRecord represents a data point of TPS at a specific time

func (TPSRecord) ReportString

func (t TPSRecord) ReportString() string

func (TPSRecord) String

func (t TPSRecord) String() string

type TPSServer

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

func NewTPSServer

func NewTPSServer(tm *TPSMonitor, port int) TPSServer

func (TPSServer) PrintTPSData

func (s TPSServer) PrintTPSData(w http.ResponseWriter, r *http.Request)

func (TPSServer) Start

func (s TPSServer) Start()

Jump to

Keyboard shortcuts

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