Skip to content

Commit

Permalink
Merge pull request #135 from lpabon/b134
Browse files Browse the repository at this point in the history
Allow describing a node even when no stats
  • Loading branch information
lpabon authored Mar 20, 2020
2 parents a1d9dc0 + 781160b commit 17766dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions handler/volume/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ func (p *VolumeDescribeFormatter) addVolumeStatsInfo(
v *api.Volume,
t *tabby.Tabby,
) error {
stats, err := p.volumes.GetStats(v, false)
if err != nil {
return err
}

// Ignore the error if it cannot get stats
stats, _ := p.volumes.GetStats(v, false)

t.AddLine("Stats:")
t.AddLine(" Reads:", stats.GetReads())
t.AddLine(" Reads MS:", stats.GetReadMs())
Expand All @@ -308,7 +308,7 @@ func (p *VolumeDescribeFormatter) addVolumeStatsInfo(
t.AddLine(" Writes MS:", stats.GetWriteMs())
t.AddLine(" Bytes Written:", stats.GetWriteBytes())
t.AddLine(" IOs in progress:", stats.GetIoProgress())
t.AddLine(" Bytes used:", humanize.BigIBytes(big.NewInt(int64(stats.BytesUsed))))
t.AddLine(" Bytes used:", humanize.BigIBytes(big.NewInt(int64(stats.GetBytesUsed()))))
return nil
}

Expand Down

0 comments on commit 17766dc

Please sign in to comment.