metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PipelineUsecaseDuration = metrics.MustNewGaugeWithTags(metrics.Options{
		Namespace: "indexer",
		Subsystem: "pipeline",
		Name:      "usecase_duration",
		Desc:      "The total time spent executing a usecase",
		Tags:      []string{"task"},
	})

	PipelineDatabaseSizeAfterHeight = metrics.MustNewGaugeWithTags(metrics.Options{
		Namespace: "indexer",
		Subsystem: "pipeline",
		Name:      "database_size",
		Desc:      "The size of the database after indexing a height",
	})

	PipelineRequestCountAfterHeight = metrics.MustNewGaugeWithTags(metrics.Options{
		Namespace: "indexer",
		Subsystem: "pipeline",
		Name:      "request_count",
		Desc:      "The total number of requests made for one height",
	})

	DatabaseQueryDuration = metrics.MustNewGaugeWithTags(metrics.Options{
		Namespace: "indexer",
		Subsystem: "database",
		Name:      "query_duration",
		Desc:      "The total time required to execute query on database",
		Tags:      []string{"query"},
	})

	ServerRequestDuration = metrics.MustNewHistogramWithTags(metrics.HistogramOptions{
		Namespace: "indexer",
		Subsystem: "server",
		Name:      "request_duration",
		Desc:      "The total time spent handling an HTTP request",
		Tags:      []string{"request"},
	})
)

Functions

func LogQueryDuration

func LogQueryDuration(start time.Time, queryName string)

func LogUsecaseDuration

func LogUsecaseDuration(start time.Time, useCaseName string)

Types

type MetricsServer

type MetricsServer struct{}

MetricsServer handles HTTP requests

func NewMetricsServer

func NewMetricsServer() *MetricsServer

NewMetricsServer returns a new server instance

func (*MetricsServer) StartServer

func (ms *MetricsServer) StartServer(listenAddr string, url string) error

StartServer starts the metrics server

Jump to

Keyboard shortcuts

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