Skip to content

Commit

Permalink
chore: Remove unimplemented 'ReadSpeedBytes' and 'WriteSpeedBytes' fi…
Browse files Browse the repository at this point in the history
…elds from the DiskData struct
  • Loading branch information
mertssmnoglu committed Dec 19, 2024
1 parent bce26b2 commit ba2ab5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
20 changes: 8 additions & 12 deletions internal/metric/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import (
func CollectDiskMetrics() (MetricsSlice, []CustomErr) {
defaultDiskData := []*DiskData{
{
Device: "unknown",
ReadSpeedBytes: nil,
WriteSpeedBytes: nil,
TotalBytes: nil,
FreeBytes: nil,
UsagePercent: nil,
Device: "unknown",
TotalBytes: nil,
FreeBytes: nil,
UsagePercent: nil,
},
}
var diskErrors []CustomErr
Expand Down Expand Up @@ -52,12 +50,10 @@ func CollectDiskMetrics() (MetricsSlice, []CustomErr) {

checkedSlice = append(checkedSlice, p.Device)
metricsSlice = append(metricsSlice, &DiskData{
Device: p.Device,
ReadSpeedBytes: nil, // TODO: Implement
WriteSpeedBytes: nil, // TODO: Implement
TotalBytes: &diskUsage.Total,
FreeBytes: &diskUsage.Free,
UsagePercent: RoundFloatPtr(diskUsage.UsedPercent/100, 4),
Device: p.Device,
TotalBytes: &diskUsage.Total,
FreeBytes: &diskUsage.Free,
UsagePercent: RoundFloatPtr(diskUsage.UsedPercent/100, 4),
})
}

Expand Down
10 changes: 4 additions & 6 deletions internal/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ type MemoryData struct {
func (m MemoryData) isMetric() {}

type DiskData struct {
Device string `json:"device"` // Device
ReadSpeedBytes *uint64 `json:"read_speed_bytes"` // TODO: Implement
WriteSpeedBytes *uint64 `json:"write_speed_bytes"` // TODO: Implement
TotalBytes *uint64 `json:"total_bytes"` // Total space of device in bytes
FreeBytes *uint64 `json:"free_bytes"` // Free space of device in bytes
UsagePercent *float64 `json:"usage_percent"` // Usage Percent of device
Device string `json:"device"` // Device
TotalBytes *uint64 `json:"total_bytes"` // Total space of device in bytes
FreeBytes *uint64 `json:"free_bytes"` // Free space of device in bytes
UsagePercent *float64 `json:"usage_percent"` // Usage Percent of device
}

func (d DiskData) isMetric() {}
Expand Down

0 comments on commit ba2ab5f

Please sign in to comment.