Skip to content

Commit

Permalink
Actually get the disk-usage, also fix int32 data issue
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko713 committed Nov 21, 2023
1 parent 377ea5a commit aeff347
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion input/system/crunchy_bridge/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (c *Client) GetLoadAverageMetrics() (*LoadAverageMetrics, error) {
}

func (c *Client) GetDiskUsageMetrics() (*DiskUsageMetrics, error) {
metricViews, err := c.getMetrics("load-average")
metricViews, err := c.getMetrics("disk-usage")
if err != nil {
return nil, err
}
Expand Down
7 changes: 4 additions & 3 deletions input/system/crunchy_bridge/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ func GetSystemState(config config.ServerConfig, logger *util.Logger) (system sta
system.DataDirectoryPartition = "/"
system.DiskPartitions = make(state.DiskPartitionMap)
system.DiskPartitions["/"] = state.DiskPartition{
DiskName: "default",
UsedBytes: diskUsageMetrics.DatabaseSize,
TotalBytes: uint64(clusterInfo.Storage * 1024 * 1024 * 1024),
DiskName: "default",
PartitionName: "default",
UsedBytes: diskUsageMetrics.DatabaseSize,
TotalBytes: uint64(clusterInfo.Storage) * 1024 * 1024 * 1024,
}

return
Expand Down

0 comments on commit aeff347

Please sign in to comment.