handler

package
v2.0.0-...-2ef6370 Latest Latest
Warning

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

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

Documentation

Overview

Package handler is the handler for the `micro debug stats` service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Stats is the Debug.Stats handler

func New

func New(done <-chan bool, windowSize int, services func() []*registry.Service) (*Stats, error)

New initialises and returns a new Stats service handler

func (*Stats) Read

func (s *Stats) Read(ctx context.Context, req *stats.ReadRequest, rsp *stats.ReadResponse) error

Read returns gets a snapshot of all current stats

func (*Stats) Start

func (s *Stats) Start(done <-chan bool)

Start Starts scraping other services until the provided channel is closed

func (*Stats) Stream

Stream starts streaming stats

func (*Stats) Write

func (s *Stats) Write(ctx context.Context, req *stats.WriteRequest, rsp *stats.WriteResponse) error

Jump to

Keyboard shortcuts

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