Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Conversation

@inket
Copy link
Contributor

@inket inket commented Jun 30, 2016

> let os = require('os')
undefined
> os.cpus()
[ { model: 'Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz',
    speed: 2494,
    times: 
     { user: 379945100,
       nice: 8095800,
       sys: 53693800,
       idle: 67719016300,
       irq: 9700 } } ]
> 
> os.cpus().length -1 
0

😅

We shouldn't assume all CPUs are declared as multicore especially when running on virtual server environments.

@goatslacker goatslacker merged commit e23fb41 into airbnb:master Jun 30, 2016
@ljharb
Copy link
Collaborator

ljharb commented Jun 30, 2016

@goatslacker we should add a test for this.

@goatslacker
Copy link
Collaborator

Sure, we'd have to mock the os module. I felt like the cost of writing the test outweighed its benefits. I'm open to PRs though :)

@ljharb
Copy link
Collaborator

ljharb commented Jun 30, 2016

Fair point :-)

@inket inket deleted the patch-1 branch July 1, 2016 00:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants