Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
910daee8
Commit
910daee8
authored
3 years ago
by
Brad Payne (Vir Linden)
Browse files
Options
Downloads
Patches
Plain Diff
SL-15999 - perfbot allow --num to default to number of creds
parent
23ec0fb5
No related branches found
No related tags found
1 merge request
!83
Merge Linden 6.6.7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/perf/perfbot_run.py
+13
-6
13 additions, 6 deletions
scripts/perf/perfbot_run.py
with
13 additions
and
6 deletions
scripts/perf/perfbot_run.py
+
13
−
6
View file @
910daee8
...
@@ -44,7 +44,6 @@
...
@@ -44,7 +44,6 @@
def
gen_niv_script
(
args
):
def
gen_niv_script
(
args
):
print
(
f
"
Launching
{
(
args
.
num
)
}
instances of the Viewer
"
)
print
(
f
"
Reading creds from
{
(
args
.
creds
)
}
folder
"
)
print
(
f
"
Reading creds from
{
(
args
.
creds
)
}
folder
"
)
print
(
f
"
Using the non interactive Viewer from
{
(
args
.
viewer
)
}
"
)
print
(
f
"
Using the non interactive Viewer from
{
(
args
.
viewer
)
}
"
)
print
(
f
"
Sleeping for
{
args
.
sleep
}
ms between Viewer launches
"
)
print
(
f
"
Sleeping for
{
args
.
sleep
}
ms between Viewer launches
"
)
...
@@ -58,6 +57,8 @@ def gen_niv_script(args):
...
@@ -58,6 +57,8 @@ def gen_niv_script(args):
creds_lines
=
[
line
.
rstrip
()
for
line
in
creds_lines
]
creds_lines
=
[
line
.
rstrip
()
for
line
in
creds_lines
]
creds_lines
=
[
line
for
line
in
creds_lines
if
not
line
.
startswith
(
"
#
"
)
and
len
(
line
)]
creds_lines
=
[
line
for
line
in
creds_lines
if
not
line
.
startswith
(
"
#
"
)
and
len
(
line
)]
# We cannot log in more users than we have credentials for
# We cannot log in more users than we have credentials for
if
args
.
num
==
0
:
args
.
num
=
len
(
creds_lines
)
if
args
.
num
>
len
(
creds_lines
):
if
args
.
num
>
len
(
creds_lines
):
print
(
print
(
f
"
The number of agents specified (
{
(
args
.
num
)
}
) exceeds
"
f
"
The number of agents specified (
{
(
args
.
num
)
}
) exceeds
"
...
@@ -65,19 +66,24 @@ def gen_niv_script(args):
...
@@ -65,19 +66,24 @@ def gen_niv_script(args):
f
"
the creds file
"
f
"
the creds file
"
)
)
return
return
print
(
f
"
Launching
{
(
args
.
num
)
}
instances of the Viewer
"
)
# The Viewer (in dev environments at least) needs a well specified
# The Viewer (in dev environments at least) needs a well specified
# working directory to function properly. We try to guess what it
# working directory to function properly. We try to guess what it
# might be based on the full path to the Viewer executable but
# might be based on the full path to the Viewer executable but
# you can also specify it explicitly with the --cwd parameter
# you can also specify it explicitly with the --cwd parameter
# (required for dev builds)
# (required for dev builds)
args
.
viewer
=
os
.
path
.
abspath
(
args
.
viewer
)
working_dir
=
args
.
cwd
working_dir
=
args
.
cwd
if
len
(
args
.
cwd
)
==
0
:
if
len
(
args
.
cwd
)
==
0
:
working_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
args
.
viewer
))
working_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
args
.
viewer
))
print
(
f
"
Working directory is
{
working_dir
}
"
)
print
(
f
"
Working directory is
{
working_dir
}
"
)
os
.
chdir
(
working_dir
)
environ
=
os
.
environ
environ
[
"
cwd
"
]
=
working_dir
if
args
.
dryrun
:
if
args
.
dryrun
:
print
(
"
Ru
u
ning in dry-run mode - no Viewers will be started
"
)
print
(
"
Ru
n
ning in dry-run mode - no Viewers will be started
"
)
print
(
""
)
print
(
""
)
for
inst
in
range
(
args
.
num
):
for
inst
in
range
(
args
.
num
):
...
@@ -111,7 +117,7 @@ def gen_niv_script(args):
...
@@ -111,7 +117,7 @@ def gen_niv_script(args):
region_y
=
center_y
region_y
=
center_y
slurl
=
f
"
secondlife://
{
args
.
region
}
/
{
region_x
}
/
{
region_y
}
/
{
region_z
}
"
slurl
=
f
"
secondlife://
{
args
.
region
}
/
{
region_x
}
/
{
region_y
}
/
{
region_z
}
"
# Bu
o
ld the script line
# Bu
i
ld the script line
script_cmd
=
[
args
.
viewer
]
script_cmd
=
[
args
.
viewer
]
script_cmd
.
append
(
PARAM_NON_INTERACTIVE
)
script_cmd
.
append
(
PARAM_NON_INTERACTIVE
)
script_cmd
.
append
(
PARAM_MULTI
)
script_cmd
.
append
(
PARAM_MULTI
)
...
@@ -131,7 +137,8 @@ def gen_niv_script(args):
...
@@ -131,7 +137,8 @@ def gen_niv_script(args):
# If --dry-run is specified, we do everything (including, most
# If --dry-run is specified, we do everything (including, most
# usefully, display the script lines) but do not start the Viewer
# usefully, display the script lines) but do not start the Viewer
if
args
.
dryrun
==
False
:
if
args
.
dryrun
==
False
:
viewer_session
=
subprocess
.
Popen
(
script_cmd
)
print
(
"
opening viewer session with
"
,
script_cmd
)
viewer_session
=
subprocess
.
Popen
(
script_cmd
,
env
=
environ
)
# Sleeping a bit between launches seems to help avoid a CPU
# Sleeping a bit between launches seems to help avoid a CPU
# surge when N Viewers are started simulatanously. The default
# surge when N Viewers are started simulatanously. The default
...
@@ -144,7 +151,7 @@ def gen_niv_script(args):
...
@@ -144,7 +151,7 @@ def gen_niv_script(args):
parser
.
add_argument
(
parser
.
add_argument
(
"
--num
"
,
"
--num
"
,
type
=
int
,
type
=
int
,
required
=
True
,
default
=
0
,
dest
=
"
num
"
,
dest
=
"
num
"
,
help
=
"
How many avatars to add to the script
"
,
help
=
"
How many avatars to add to the script
"
,
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment