Skip to content

Commit

Permalink
fix: markdown bug for influxdata#15951 influxdata#15950
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxianfu committed Sep 30, 2024
1 parent 09535fe commit 419e433
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions plugins/inputs/diskio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ diskio,name=sda1 merged_reads=0i,reads=2353i,writes=10i,write_bytes=2117632i,wri
diskio,name=centos/var_log reads=1063077i,writes=591025i,read_bytes=139325491712i,write_bytes=144233131520i,read_time=650221i,write_time=24368817i,io_time=852490i,weighted_io_time=25037394i,iops_in_progress=1i,merged_reads=0i,merged_writes=0i 1578326400000000000
diskio,name=sda write_time=49i,io_time=1317i,weighted_io_time=1404i,reads=2495i,read_time=1357i,write_bytes=2117632i,iops_in_progress=0i,merged_reads=0i,merged_writes=0i,writes=10i,read_bytes=38956544i 1578326400000000000
```

```text
diskio,name=sda io_await:0.3317307692307692,io_svctm:0.07692307692307693,io_util:0.5329780146568954
```
8 changes: 4 additions & 4 deletions plugins/inputs/diskio/diskio.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type DiskIO struct {
warnDiskName map[string]bool
warnDiskTags map[string]bool
lastIOCounterStat map[string]disk.IOCountersStat
lastCollectIOTime time.Time
lastCollectTime time.Time
}

func (*DiskIO) SampleConfig() string {
Expand Down Expand Up @@ -77,7 +77,7 @@ func (d *DiskIO) Gather(acc telegraf.Accumulator) error {
if err != nil {
return fmt.Errorf("error getting disk io info: %w", err)
}
collectIOTime := time.Now()
collectTime := time.Now()
for k, io := range diskio {
match := false
if d.deviceFilter != nil && d.deviceFilter.Match(io.Name) {
Expand Down Expand Up @@ -146,7 +146,7 @@ func (d *DiskIO) Gather(acc telegraf.Accumulator) error {
//util:The percentage of time the disk (%)
//itv:Represents the time interval between two statistics measurements
//util = (new.tot_ticks - old.tot_ticks)/ itv
itv := float64(collectIOTime.Sub(d.lastCollectIOTime).Milliseconds())
itv := float64(collectTime.Sub(d.lastCollectTime).Milliseconds())
if itv > 0 {
fieldsG["io_util"] = 100 * deltaIOTime / itv
}
Expand All @@ -157,7 +157,7 @@ func (d *DiskIO) Gather(acc telegraf.Accumulator) error {
}
acc.AddCounter("diskio", fieldsC, tags)
}
d.lastCollectIOTime = collectIOTime
d.lastCollectTime = collectTime
d.lastIOCounterStat = diskio
return nil
}
Expand Down

0 comments on commit 419e433

Please sign in to comment.