diff --git a/v3/internal/sysinfo/memtotal_js.go b/v3/internal/sysinfo/memtotal_js.go new file mode 100644 index 000000000..a0d81766f --- /dev/null +++ b/v3/internal/sysinfo/memtotal_js.go @@ -0,0 +1,11 @@ +// Copyright 2020 New Relic Corporation. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +package sysinfo + +import "errors" + +// PhysicalMemoryBytes returns the total amount of host memory. +func PhysicalMemoryBytes() (uint64, error) { + return 0, errors.New("not supported on GOOS=js") +} diff --git a/v3/internal/sysinfo/usage_js.go b/v3/internal/sysinfo/usage_js.go new file mode 100644 index 000000000..74f8ce160 --- /dev/null +++ b/v3/internal/sysinfo/usage_js.go @@ -0,0 +1,11 @@ +// Copyright 2020 New Relic Corporation. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +package sysinfo + +import "errors" + +// GetUsage gathers process times. +func GetUsage() (Usage, error) { + return Usage{}, errors.New("not supported on GOOS=js") +} diff --git a/v3/internal/sysinfo/usage_posix.go b/v3/internal/sysinfo/usage_posix.go index 4d758dea1..5b553fd90 100644 --- a/v3/internal/sysinfo/usage_posix.go +++ b/v3/internal/sysinfo/usage_posix.go @@ -1,7 +1,7 @@ // Copyright 2020 New Relic Corporation. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -// +build !windows +// +build !windows,!js package sysinfo