codecounter

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package codecounter provides a goroutine unsafe HTTP status code counter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPStatusCodeCounter

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

HTTPStatusCodeCounter is the goroutine unsafe HTTP status code counter. It is designed for counting http status code which is 1XX - 5XX, So the code range are limited to [0, 999]

func New

func New() *HTTPStatusCodeCounter

New creates a HTTPStatusCodeCounter.

func (*HTTPStatusCodeCounter) Codes

func (cc *HTTPStatusCodeCounter) Codes() map[int]uint64

Codes returns the codes.

func (*HTTPStatusCodeCounter) Count

func (cc *HTTPStatusCodeCounter) Count(code int)

Count counts a new code.

func (*HTTPStatusCodeCounter) Reset

func (cc *HTTPStatusCodeCounter) Reset()

Reset resets counters of all codes to zero

Jump to

Keyboard shortcuts

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