mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
work of 1 min load and set server as up
This commit is contained in:
parent
260987336d
commit
2864d776f5
1 changed files with 2 additions and 2 deletions
|
@ -131,11 +131,11 @@ os = require('os')
|
|||
|
||||
|
||||
server = net.createServer (socket) ->
|
||||
fiveMinLoad = os.loadavg()[1]
|
||||
fiveMinLoad = os.loadavg()[0]
|
||||
availableWorkingCpus = os.cpus().length - 1
|
||||
freeLoad = availableWorkingCpus - fiveMinLoad
|
||||
freeLoadPercentage = Math.round((freeLoad / availableWorkingCpus) * 100)
|
||||
socket.write "#{freeLoadPercentage}%\n", "ASCII"
|
||||
socket.write "up, #{freeLoadPercentage}%\n", "ASCII"
|
||||
socket.pipe socket
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in a new issue