Update dependencies

This commit is contained in:
github-actions
2024-04-03 22:17:34 +00:00
parent 4c92bd54a2
commit 6c34d567d4
10 changed files with 68 additions and 75 deletions
+3 -3
View File
@@ -75,14 +75,14 @@ func ResponseFormat(h http.Header) Format {
func NewDecoder(r io.Reader, format Format) Decoder {
switch format.FormatType() {
case TypeProtoDelim:
return &protoDecoder{r: r}
return &protoDecoder{r: bufio.NewReader(r)}
}
return &textDecoder{r: r}
}
// protoDecoder implements the Decoder interface for protocol buffers.
type protoDecoder struct {
r io.Reader
r protodelim.Reader
}
// Decode implements the Decoder interface.
@@ -90,7 +90,7 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error {
opts := protodelim.UnmarshalOptions{
MaxSize: -1,
}
if err := opts.UnmarshalFrom(bufio.NewReader(d.r), v); err != nil {
if err := opts.UnmarshalFrom(d.r, v); err != nil {
return err
}
if !model.IsValidMetricName(model.LabelValue(v.GetName())) {
+1 -1
View File
@@ -45,7 +45,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
bufSize := sizeOfStatvfs * mountedFsCount
buf := make([]Statvfs, mountedFsCount)
// request agian to get desired mount data
// request again to get desired mount data
_, _, err = unix.Syscall(
483, // SYS___getvfsstat90 syscall
uintptr(unsafe.Pointer(&buf[0])),
+27 -26
View File
@@ -1,4 +1,4 @@
// Created by cgo -godefs - DO NOT EDIT
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_linux.go
package host
@@ -9,7 +9,7 @@ const (
sizeofInt = 0x4
sizeofLong = 0x8
sizeofLongLong = 0x8
sizeOfUtmp = 0x180
sizeOfUtmp = 0x190
)
type (
@@ -19,27 +19,28 @@ type (
_C_long_long int64
)
type utmp struct {
Type int16
Pad_cgo_0 [2]byte
Pid int32
Line [32]int8
Id [4]int8
User [32]int8
Host [256]int8
Exit exit_status
Session int32
Tv timeval
Addr_v6 [4]int32
X__glibc_reserved [20]int8
}
type exit_status struct {
Termination int16
Exit int16
}
type timeval struct {
Sec int64
Usec int64
}
type (
utmp struct {
Type int16
Pad_cgo_0 [2]byte // changed by hand #1603
Pid int32
Line [32]int8 // changed by hand
Id [4]int8 // changed by hand
User [32]int8 // changed by hand
Host [256]int8 // changed by hand
Exit exit_status
Session int64
Tv timeval
Addr_v6 [4]int32
X__glibc_reserved [20]uint8
Pad_cgo_1 [4]byte
}
exit_status struct {
Termination int16
Exit int16
}
timeval struct {
Sec int64
Usec int64
}
)
+1 -9
View File
@@ -107,7 +107,7 @@ func MiscWithContext(ctx context.Context) (*MiscStat, error) {
}
procsTotal, err := getProcsTotal(ctx)
procsTotal, err := common.NumProcsWithContext(ctx)
if err != nil {
return ret, err
}
@@ -116,14 +116,6 @@ func MiscWithContext(ctx context.Context) (*MiscStat, error) {
return ret, nil
}
func getProcsTotal(ctx context.Context) (int64, error) {
values, err := readLoadAvgFromFile(ctx)
if err != nil {
return 0, err
}
return strconv.ParseInt(strings.Split(values[3], "/")[1], 10, 64)
}
func readLoadAvgFromFile(ctx context.Context) ([]string, error) {
loadavgFilename := common.HostProcWithContext(ctx, "loadavg")
line, err := os.ReadFile(loadavgFilename)
+17 -17
View File
@@ -1,8 +1,7 @@
//go:build freebsd && arm64
// +build freebsd,arm64
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs process/types_freebsd.go
// cgo -godefs types_freebsd.go
package process
@@ -82,14 +81,14 @@ type Rlimit struct {
type KinfoProc struct {
Structsize int32
Layout int32
Args *int64 /* pargs */
Paddr *int64 /* proc */
Addr *int64 /* user */
Tracep *int64 /* vnode */
Textvp *int64 /* vnode */
Fd *int64 /* filedesc */
Vmspace *int64 /* vmspace */
Wchan *byte
Args int64 /* pargs */
Paddr int64 /* proc */
Addr int64 /* user */
Tracep int64 /* vnode */
Textvp int64 /* vnode */
Fd int64 /* filedesc */
Vmspace int64 /* vmspace */
Wchan int64
Pid int32
Ppid int32
Pgid int32
@@ -140,7 +139,7 @@ type KinfoProc struct {
Wmesg [9]uint8
Login [18]uint8
Lockname [9]uint8
Comm [20]int8
Comm [20]int8 // changed from uint8 by hand
Emul [17]uint8
Loginclass [18]uint8
Moretdname [4]uint8
@@ -159,11 +158,12 @@ type KinfoProc struct {
Pri Priority
Rusage Rusage
Rusage_ch Rusage
Pcb *int64 /* pcb */
Kstack *byte
Udata *byte
Tdaddr *int64 /* thread */
Spareptrs [6]*byte
Pcb int64 /* pcb */
Kstack int64
Udata int64
Tdaddr int64 /* thread */
Pd int64 /* pwddesc, not accurate */
Spareptrs [5]int64
Sparelongs [12]int64
Sflag int64
Tdflags int64
@@ -195,7 +195,7 @@ type KinfoVmentry struct {
Vn_rdev_freebsd11 uint32
Vn_mode uint16
Status uint16
Vn_fsid uint64
Type_spec [8]byte
Vn_rdev uint64
X_kve_ispare [8]int32
Path [1024]uint8