httputils

package module
v0.0.0-...-932bbde Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProcessHash string
View Source
var RegexPid = regexp.MustCompile(`^\d+$`)

Functions

func FiberMemoryHandler

func FiberMemoryHandler() fiber.Handler

func FiberPsHandler

func FiberPsHandler() fiber.Handler

func HttpMemoryHandler

func HttpMemoryHandler() http.Handler

Types

type HttpMemoryHandlerImpl

type HttpMemoryHandlerImpl struct {
}

func (*HttpMemoryHandlerImpl) ServeHTTP

type Memory

type Memory struct {
	Id                 string                    `json:"id"`
	MemTotal           int                       `json:"total"`
	MemFree            int                       `json:"free"`
	MemAvailable       int                       `json:"available"`
	RuntimeMemoryStats SimplifiedRuntimeMemStats `json:"runtimeMemoryStats"`
	PsEntries          []PsEntry                 `json:"psEntries"`
}

func ReadMemoryStats

func ReadMemoryStats() (memoryStats Memory, err error)

func (Memory) MarshalEasyJSON

func (m Memory) MarshalEasyJSON(w *jwriter.Writer)

type PsEntry

type PsEntry struct {
	Pid      int     `json:"pid"`
	User     string  `json:"user"`
	VmRss    string  `json:"vmRss"`
	VmSize   string  `json:"vmSize"`
	Name     string  `json:"name"`
	CpuUsage float64 `json:"cpuUsage"`
}

type SimplifiedRuntimeMemStats

type SimplifiedRuntimeMemStats struct {
	Alloc        float64 `json:"alloc"`
	TotalAlloc   float64 `json:"totalAlloc"`
	Sys          float64 `json:"sys"`
	Lookups      float64 `json:"lookups"`
	Mallocs      float64 `json:"mallocs"`
	Frees        float64 `json:"frees"`
	HeapAlloc    float64 `json:"heapAlloc"`
	HeapSys      float64 `json:"heapSys"`
	HeapIdle     float64 `json:"heapIdle"`
	HeapInuse    float64 `json:"heapInuse"`
	HeapReleased float64 `json:"heapReleased"`
	HeapObjects  float64 `json:"heapObjects"`
	StackInuse   float64 `json:"stackInuse"`
	StackSys     float64 `json:"stackSys"`
	MSpanInuse   float64 `json:"mSpanInuse"`
	MSpanSys     float64 `json:"mSpanSys"`
}

Jump to

Keyboard shortcuts

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