Skip to content

Commit

Permalink
define paramter for reactor thread pool size
Browse files Browse the repository at this point in the history
Precommit-Verified: dd6c120b4089d83a8364f85693568a5cac01db1b0cd4c0aa2b66e42090052663
  • Loading branch information
thuvh authored and Hoai-Thu Vuong committed Jul 20, 2022
1 parent f32eaa9 commit 0624e51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vmware_exporter/vmware_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,8 @@ def main(argv=None):
parser.add_argument('-v', '--version', action="version",
version='vmware_exporter {version}'.format(version=__version__),
help='Print version and exit')
parser.add_argument('-ps', '--pool-size', dest="pool_size", type=int,
default=25, help="Set thread pool size")

args = parser.parse_args(argv or sys.argv[1:])

Expand All @@ -2050,7 +2052,7 @@ def main(argv=None):
raise ValueError("Invalid log level: {level}".format(level=args.loglevel))
logging.basicConfig(level=numeric_level, format='%(asctime)s %(levelname)s:%(message)s')

reactor.suggestThreadPoolSize(25)
reactor.suggestThreadPoolSize(args.pool_size)

factory = Site(registerEndpoints(args))
logging.info("Starting web server on port {address}:{port}".format(address=args.address, port=args.port))
Expand Down

0 comments on commit 0624e51

Please sign in to comment.