system

package
v0.0.0-...-fd63c1f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoggerMap map[string]logpkg.Logger

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func DumpTable

func DumpTable(ctx *server.Context) (interface{}, int)

func FlushDatabases

func FlushDatabases(ctx *server.Context) (interface{}, int)

func FlushJournals

func FlushJournals(ctx *server.Context) (interface{}, int)

func GcDatabases

func GcDatabases(ctx *server.Context) (interface{}, int)

func GetCacheStats

func GetCacheStats(ctx *server.Context) (interface{}, int)

func GetConfig

func GetConfig(ctx *server.Context) (interface{}, int)

func GetSysStats

func GetSysStats(ctx *server.Context) (interface{}, int)

func GetTableStats

func GetTableStats(ctx *server.Context) (interface{}, int)

func PurgeCaches

func PurgeCaches(ctx *server.Context) (interface{}, int)

func RollbackDatabases

func RollbackDatabases(ctx *server.Context) (interface{}, int)

func SnapshotDatabases

func SnapshotDatabases(ctx *server.Context) (interface{}, int)

func UpdateLog

func UpdateLog(ctx *server.Context) (interface{}, int)

func UseLogger

func UseLogger(logger logpkg.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type RollbackRequest

type RollbackRequest struct {
	Height int64 `schema:"height" json:"height"` // negative height is treated as offset
	Force  bool  `schema:"force"  json:"force"`  // ignore errors
}

type SysStat

type SysStat struct {
	Hostname      string    `json:"hostname"`
	ContainerName string    `json:"container_name"`
	Timestamp     time.Time `json:"timestamp"`

	NumCpu       int    `json:"num_cpu"`
	NumGoroutine int    `json:"num_goroutine"`
	NumThreads   uint64 `json:"num_threads"`
	TotalMem     uint64 `json:"total_mem"`
	TotalSwap    uint64 `json:"total_swap"`

	VmPageFaults uint64 `json:"vm_page_faults"`
	VmPeak       uint64 `json:"vm_peak"` // Peak virtual memory size.
	VmSize       uint64 `json:"vm_size"` // Virtual memory size.
	VmSwap       uint64 `json:"vm_swap"` // Swapped-out virtual memory size
	VmRss        uint64 `json:"vm_rss"`  // Resident set size. (mapped + anon + shm)
	VmMapped     uint64 `json:"vm_map"`  // Size of resident file mappings.
	VmAnon       uint64 `json:"vm_anon"` // Size of resident anonymous memory.
	VmShm        uint64 `json:"vm_shm"`  // Size of resident shared memory.

	MemMallocs    uint64 `json:"mem_mallocs"`
	MemFrees      uint64 `json:"mem_frees"`
	MemHeapAlloc  uint64 `json:"mem_heap"`
	MemStackInuse uint64 `json:"mem_stack"`

	DiskSize uint64 `json:"disk_size"`
	DiskUsed uint64 `json:"disk_used"`
	DiskFree uint64 `json:"disk_free"`

	CpuUser  float64 `json:"cpu_user"`
	CpuSys   float64 `json:"cpu_system"`
	CpuTotal float64 `json:"cpu_total"`
}

type SystemRequest

type SystemRequest struct{}

func (SystemRequest) Expires

func (t SystemRequest) Expires() time.Time

func (SystemRequest) LastModified

func (t SystemRequest) LastModified() time.Time

func (SystemRequest) RESTPath

func (t SystemRequest) RESTPath(r *mux.Router) string

func (SystemRequest) RESTPrefix

func (t SystemRequest) RESTPrefix() string

func (SystemRequest) RegisterDirectRoutes

func (t SystemRequest) RegisterDirectRoutes(r *mux.Router) error

func (SystemRequest) RegisterRoutes

func (t SystemRequest) RegisterRoutes(r *mux.Router) error

Jump to

Keyboard shortcuts

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