sysutil

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 24 Imported by: 15 modules, 30 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sysutil

sysutil is a library which implementats the gRPC service Diagnostics and shares the diagnostics functions between TiDB and PD.

Search log

The semantics of the log search service is: search for local log files, and filter using predicates, and then return the matched results.

The following are the predicates that the log interface needs to process:

  • start_time: start time of the log retrieval (Unix timestamp, in milliseconds). If there is no such predicate, the default is 0.
  • end_time:: end time of the log retrieval (Unix timestamp, in milliseconds). If there is no such predicate, the default is int64::MAX.
  • pattern: filter pattern determined by the keyword. For example, SELECT * FROM tidb_cluster_log WHERE "%gc%" %gc% is the filtered keyword.
  • level: log level; can be selected as DEBUG/INFO/WARN/WARNING/TRACE/CRITICAL/ERROR
  • limit: the maximum of logs items to return, preventing the log from being too large and occupying a large bandwidth of the network.. If not specified, the default limit is 64k.

System information collect

Hardware
  • CPU
  • NIC
  • Disk
  • Memory
System
  • sysctl
  • process list
Load
  • CPU
  • Memory
  • NIC
  • Disk IO

Documentation

Index

Constants

View Source
const (
	// TimeStampLayout is accessed in dashboard, keep it public
	TimeStampLayout = "2006/01/02 15:04:05.000 -07:00"
)

Variables

This section is empty.

Functions

func ParseLogLevel

func ParseLogLevel(s string) pb.LogLevel

ParseLogLevel returns LogLevel from string and return LogLevel_Info if the string is an invalid level string

Types

type DiagnosticsServer

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

func NewDiagnosticsServer

func NewDiagnosticsServer(logFile string) *DiagnosticsServer

func (*DiagnosticsServer) SearchLog

func (d *DiagnosticsServer) SearchLog(req *pb.SearchLogRequest, stream pb.Diagnostics_SearchLogServer) (err error)

SearchLog implements the DiagnosticsServer interface.

func (*DiagnosticsServer) ServerInfo

ServerInfo implements the DiagnosticsServer interface.

Jump to

Keyboard shortcuts

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