Use multiprocessing.cpu_count instead of psutil.NUM_CPUS
psutil.NUM_CPUS has been deprecated in psutil 2.x While currently global-requirements restrict usage of psutil to versions <2.0.0 it can be good to be prepared for upgrade in advance. This commit makes use of multiprocessing module instead. Change-Id: I6a4653eb7e5c26c3068a4d766acb4bc219920f75 Closes-Bug: #1598208
This commit is contained in:
parent
df761a16f3
commit
8fb54da2f9
|
@ -14,6 +14,7 @@
|
|||
|
||||
|
||||
import json
|
||||
import multiprocessing
|
||||
import socket
|
||||
import time
|
||||
|
||||
|
@ -72,7 +73,7 @@ class StatsCollectingService(service.Service):
|
|||
v1.stats.error_count,
|
||||
v1.stats.average_time,
|
||||
v1.stats.requests_per_tenant,
|
||||
psutil.NUM_CPUS,
|
||||
multiprocessing.cpu_count(),
|
||||
psutil.cpu_percent())
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue