File: sysinfo.go

package info (click to toggle)
receptor 1.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,772 kB
  • sloc: python: 1,643; makefile: 305; sh: 174
file content (17 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package utils

import (
	"runtime"

	"github.com/pbnjay/memory"
)

// GetSysCPUCount returns number of logical CPU cores on the system.
func GetSysCPUCount() int {
	return runtime.NumCPU()
}

// GetSysMemoryMiB returns the capacity (in mebibytes) of the physical memory installed on the system.
func GetSysMemoryMiB() uint64 {
	return memory.TotalMemory() / 1048576 // bytes to MiB
}