mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* [MM-66840] Add CPU cores and total memory to support packet Add system resource information to support packet diagnostics to help with troubleshooting and capacity analysis. * Clarify that memory is in MB * Add comment clarifying CPU/memory are host values Clarifies that the CPU cores and total memory values in the support packet represent the host machine's resources, not any container limits that may be configured in Docker or Kubernetes environments. --------- Co-authored-by: Hanzo Dev <[email protected]>
22 lines
471 B
Go
22 lines
471 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
//go:build linux
|
|
|
|
package platform
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
// getTotalMemory returns the total system memory in bytes.
|
|
func getTotalMemory() (uint64, error) {
|
|
var info syscall.Sysinfo_t
|
|
err := syscall.Sysinfo(&info)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
// Sysinfo returns memory in units of info.Unit bytes
|
|
return info.Totalram * uint64(info.Unit), nil
|
|
}
|