metric

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IndexerHeightSuccess = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "figment",
		Subsystem: "indexer",
		Name:      "height_success",
		Help:      "The total number of successfully indexed heights",
	})

	IndexerTotalErrors = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "figment",
		Subsystem: "indexer",
		Name:      "total_error",
		Help:      "The total number of failures during indexing",
	})

	IndexerHeightDuration = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "figment",
		Subsystem: "indexer",
		Name:      "height_duration",
		Help:      "The total time required to index one height",
	})

	IndexerTaskDuration = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "figment",
			Subsystem: "indexer",
			Name:      "height_task_duration",
			Help:      "The total time required to process indexing task",
		},
		[]string{"task"},
	)

	IndexerUseCaseDuration = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "figment",
			Subsystem: "indexer",
			Name:      "use_case_duration",
			Help:      "The total time required to execute use case",
		},
		[]string{"task"},
	)

	IndexerDbSizeAfterHeight = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "figment",
		Subsystem: "indexer",
		Name:      "db_size",
		Help:      "The size of the database after indexing of height",
	})
)
View Source
var (
	DatabaseQueryDuration = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "figment",
			Subsystem: "database",
			Name:      "query_duration",
			Help:      "The total time required to execute query on database",
		},
		[]string{"query"},
	)

	ServerRequestDuration = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "figment",
			Subsystem: "server",
			Name:      "request_duration",
			Help:      "The total time required to execute http request",
		},
		[]string{"request"},
	)
)

Functions

func LogIndexerTaskDuration

func LogIndexerTaskDuration(start time.Time, taskName string)

func LogUseCaseDuration

func LogUseCaseDuration(start time.Time, useCaseName string)

Types

type IndexerMetric

type IndexerMetric struct{}

IndexerMetric handles HTTP requests

func NewIndexerMetric

func NewIndexerMetric() *IndexerMetric

NewIndexerMetric returns a new server instance

func (*IndexerMetric) StartServer

func (m *IndexerMetric) StartServer(listenAdd string, url string) error

type ServerMetric

type ServerMetric struct{}

ServerMetric handles HTTP requests

func NewServerMetric

func NewServerMetric() *ServerMetric

NewDatabaseMetric returns a new server instance

func (*ServerMetric) StartServer

func (m *ServerMetric) StartServer(listenAdd string, url string) error

Jump to

Keyboard shortcuts

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