diff --git a/metrics/cpu_disabled.go b/metrics/cpu_disabled.go
index 6c3428993f..b0b483ee4b 100644
--- a/metrics/cpu_disabled.go
+++ b/metrics/cpu_disabled.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
-// +build ios
+// +build ios js
package metrics
diff --git a/metrics/cpu_enabled.go b/metrics/cpu_enabled.go
index 02192928b7..edb824d9aa 100644
--- a/metrics/cpu_enabled.go
+++ b/metrics/cpu_enabled.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
-// +build !ios
+// +build !ios,!js
package metrics
diff --git a/metrics/cpu_windows.go b/metrics/cputime_nop.go
similarity index 97%
rename from metrics/cpu_windows.go
rename to metrics/cputime_nop.go
index fb29a52a82..1bf5537277 100644
--- a/metrics/cpu_windows.go
+++ b/metrics/cputime_nop.go
@@ -14,6 +14,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
+// +build windows js
+
package metrics
// getProcessCPUTime returns 0 on Windows as there is no system call to resolve
diff --git a/metrics/cpu_syscall.go b/metrics/cputime_unix.go
similarity index 98%
rename from metrics/cpu_syscall.go
rename to metrics/cputime_unix.go
index 50e04ef1d3..55871e668c 100644
--- a/metrics/cpu_syscall.go
+++ b/metrics/cputime_unix.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
-// +build !windows
+// +build !windows,!js
package metrics
diff --git a/metrics/runtime_cgo.go b/metrics/runtime_cgo.go
index e3391f4e89..11722f76cc 100644
--- a/metrics/runtime_cgo.go
+++ b/metrics/runtime_cgo.go
@@ -1,5 +1,4 @@
-// +build cgo
-// +build !appengine
+// +build cgo,!appengine,!js
package metrics
diff --git a/metrics/runtime_no_cgo.go b/metrics/runtime_no_cgo.go
index 616a3b4751..e760af554f 100644
--- a/metrics/runtime_no_cgo.go
+++ b/metrics/runtime_no_cgo.go
@@ -1,4 +1,4 @@
-// +build !cgo appengine
+// +build !cgo appengine js
package metrics