metrics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 3 Imported by: 0

Documentation

Overview

Package metrics provides a lot of tnet runtime monitoring data, such as monitoring the efficiency of batch reads and writes, which is a good tool for performance tuning.

Index

Constants

View Source
const (
	// TCP metrics
	TCPReadvCalls = iota
	TCPReadvFails
	TCPReadvBytes
	TCPWritevCalls
	TCPWritevFails
	TCPWritevBlocks
	TCPWriteNotify
	TCPOnWriteCalls
	TCPFlushCalls
	TCPConnsCreate
	TCPConnsClose
	TCPPostponeWriteOff
	TCPPostponeWriteOn

	// UDP metrics
	UDPRecvMMsgCalls
	UDPRecvMMsgFails
	UDPRecvMMsgPackets
	UDPWriteToCalls
	UDPWriteToFails
	UDPSendMMsgCalls
	UDPSendMMsgFails
	UDPSendMMsgPackets

	// Epoll metrics
	EpollWait
	EpollNoWait
	EpollEvents
	TaskAssigned
	Max
)

All metrics definitions.

Variables

This section is empty.

Functions

func Add

func Add(name int, delta uint64)

Add metrics counter.

func Get

func Get(name int) uint64

Get one metric counter.

func GetAll

func GetAll() [Max]uint64

GetAll get all metrics.

func ShowMetrics

func ShowMetrics()

ShowMetrics shows metric info in console.

func ShowMetricsOfPeriod

func ShowMetricsOfPeriod(d time.Duration)

ShowMetricsOfPeriod shows metric info of duration d from now on. It will block d duration, and then prints metrics info.

Types

This section is empty.

Jump to

Keyboard shortcuts

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