fix comment

This commit is contained in:
fengzixu 2022-01-11 14:28:31 +00:00
parent f96449f2e2
commit 5d544d3f01
3 changed files with 9 additions and 7 deletions

View File

@ -64,7 +64,7 @@ var (
volumeStatsHealthAbnormalDesc = metrics.NewDesc(
metrics.BuildFQName("", kubeletmetrics.KubeletSubsystem, kubeletmetrics.VolumeStatsHealthStatusKey),
"Volume health status. The count is either 1 or 0. When volume_health_status is abnormal, 1 indicates the volume is unhealthy, 0 indicates volume is healthy",
"Abnormal volume health status. The count is either 1 or 0. When volume_health_status is abnormal, 1 indicates the volume is unhealthy, 0 indicates volume is healthy",
[]string{"namespace", "persistentvolumeclaim", "volume_health_status"}, nil,
metrics.ALPHA, "")
)

View File

@ -47,7 +47,7 @@ func TestVolumeStatsCollector(t *testing.T) {
# TYPE kubelet_volume_stats_inodes_used gauge
# HELP kubelet_volume_stats_used_bytes [ALPHA] Number of used bytes in the volume
# TYPE kubelet_volume_stats_used_bytes gauge
# HELP kubelet_volume_stats_health_status [ALPHA] Volume health status. The count is either 1 or 0. When volume_health_status is abnormal, 1 indicates the volume is unhealthy, 0 indicates volume is healthy
# HELP kubelet_volume_stats_health_status [ALPHA] Abnormal volume health status. The count is either 1 or 0. When volume_health_status is abnormal, 1 indicates the volume is unhealthy, 0 indicates volume is healthy
# TYPE kubelet_volume_stats_health_status gauge
`

View File

@ -179,7 +179,6 @@ func (s *volumeStatCalculator) parsePodVolumeStats(podName string, pvcRef *stats
var (
available, capacity, used, inodes, inodesFree, inodesUsed uint64
volumeStats stats.VolumeStats
)
if metric.Available != nil {
@ -201,10 +200,13 @@ func (s *volumeStatCalculator) parsePodVolumeStats(podName string, pvcRef *stats
inodesUsed = uint64(metric.InodesUsed.Value())
}
volumeStats.FsStats = stats.FsStats{Time: metric.Time, AvailableBytes: &available, CapacityBytes: &capacity,
UsedBytes: &used, Inodes: &inodes, InodesFree: &inodesFree, InodesUsed: &inodesUsed}
volumeStats.Name = podName
volumeStats.PVCRef = pvcRef
volumeStats := stats.VolumeStats{
Name: podName,
PVCRef: pvcRef,
FsStats: stats.FsStats{Time: metric.Time, AvailableBytes: &available, CapacityBytes: &capacity,
UsedBytes: &used, Inodes: &inodes, InodesFree: &inodesFree, InodesUsed: &inodesUsed},
}
if metric.Abnormal != nil {
volumeStats.VolumeHealthStats = &stats.VolumeHealthStats{
Abnormal: *metric.Abnormal,