forked from gracinet/anyblok_wms_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main script: command line args and profiling
The profiling makes use of the pyprof2calltree converter to files expected by kcachegrind. For now CLI args are in a separate argparse instance (to be better integrated later with Anyblok's Configuration)
- Loading branch information
Showing
4 changed files
with
111 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
|
||
|
||
def init_config(**kw): | ||
from .basic import config # flake8: noqa | ||
from .launcher import config # flake8: noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is a part of the AnyBlok / WMS Examples project | ||
# | ||
# Copyright (C) 2018 Georges Racinet <gracinet@anybox.fr> | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public License, | ||
# v. 2.0. If a copy of the MPL was not distributed with this file,You can | ||
# obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from anyblok.config import Configuration | ||
|
||
|
||
Configuration.add_application_properties( | ||
'wms-bench', ['logging', 'database', 'wms-bench'], | ||
prog='AnyBlok WMS Example and Bench', | ||
description="Example Anyblok WMS application without human interaction, " | ||
"for demonstration and performance analysis.""" | ||
) | ||
|
||
|
||
@Configuration.add('wms-bench', label="WMS Benchmarking") | ||
def bench_options(group): | ||
group.add_argument("--timeslices", type=int, default=10, | ||
help="Number of time slices to run") | ||
group.add_argument("--planner-workers", type=int, default=2, | ||
help="Number of planner worker processes to run") | ||
group.add_argument("--regular-workers", type=int, default=4, | ||
help="Number of regular worker processes to run. " | ||
"in a normal application, these would be the ones " | ||
"reacting to external events (bus, HTTP requests)") | ||
group.add_argument("--with-profile", action='store_true', | ||
help="If set, activates profiling") | ||
group.add_argument("--profile-file", default='wms.stats', | ||
help="Base filename for profile files. " | ||
"if pyprof2calltree is installed, they'll " | ||
"be converted in .kgrind files, to visualize " | ||
"with kcachegrind") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters