prometheus

package
v0.0.0-...-49b09bb Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Name       string
	StartedAt  time.Time
	FinishedAt time.Time
	Duration   float64
}

CLI define a CLI app

func NewCLI

func NewCLI(name string) *CLI

NewCLI create a new CLI app

func (*CLI) Finished

func (c *CLI) Finished()

Finished app finished

func (*CLI) Started

func (c *CLI) Started()

Started start monitoring the app

type HTTP

type HTTP struct {
	Handler    string
	Method     string
	StatusCode string
	StartedAt  time.Time
	FinishedAt time.Time
	Duration   float64
}

HTTP application

func NewHTTP

func NewHTTP(handler string, method string) *HTTP

NewHTTP create a new HTTP app

func (*HTTP) Finished

func (h *HTTP) Finished()

Finished app finished

func (*HTTP) Started

func (h *HTTP) Started()

Started start monitoring the app

type Service

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

Service implements UseCase interface

func NewPrometheusService

func NewPrometheusService() (*Service, error)

NewPrometheusService create a new prometheus service

func (*Service) CLI

func (s *Service) CLI(c *CLI) error

CLI send metrics to server

func (*Service) HTTP

func (s *Service) HTTP(h *HTTP)

HTTP send metrics to server

type TypeMetric

type TypeMetric interface {
	CLI(c *CLI) error
	HTTP(h *HTTP)
}

Type definition

Jump to

Keyboard shortcuts

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