Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/node): Fix os.cpus() on Linux #27592

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

littledivy
Copy link
Member

Populate speed using current scaling frequency and fix times multiplier.

Fixes #27555

Node.js Deno
> os.cpus()
[
  {
    model: 'AMD Ryzen 5 7530U with Radeon Graphics',
    speed: 1396,
    times: {
      user: 1769930,
      nice: 20,
      sys: 525630,
      idle: 41325700,
      irq: 110060
    }
  },
> os.cpus()
[
  {
    model: "AMD Ryzen 5 7530U with Radeon Graphics",
    speed: 1630,
    times: [Object: null prototype] {
      user: 1795620,
      nice: 20,
      sys: 537840,
      idle: 41589390,
      irq: 111230
    }
  },

@littledivy littledivy merged commit fffa380 into denoland:main Jan 8, 2025
17 checks passed
dsherret pushed a commit that referenced this pull request Jan 9, 2025
Populate `speed` using current scaling frequency and fix times
multiplier.

Fixes #27555

<table>
<tr>
<th>Node.js</th>
<th>Deno</th>
</tr>
<tr>
<td>

```
> os.cpus()
[
  {
    model: 'AMD Ryzen 5 7530U with Radeon Graphics',
    speed: 1396,
    times: {
      user: 1769930,
      nice: 20,
      sys: 525630,
      idle: 41325700,
      irq: 110060
    }
  },
```

</td>
<td>

```
> os.cpus()
[
  {
    model: "AMD Ryzen 5 7530U with Radeon Graphics",
    speed: 1630,
    times: [Object: null prototype] {
      user: 1795620,
      nice: 20,
      sys: 537840,
      idle: 41589390,
      irq: 111230
    }
  },
```

</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux - Node os.cpus polyfill - speed not defined
2 participants