public class HydraThreadGroup extends Object implements Serializable
A hydra thread group is specified by a logical name and a list of
HydraThreadSubgroup, each of which contains the total number of
threads in the subgroup, an optional number of VMs from which to choose the
threads, and an optional set of logical client names from which to choose
the VMs.
Threads not otherwise assigned to groups are assigned to the default group,
named DEFAULT_NAME.
INITTASKs, CLOSETASKs, and TASKs can optionally specify a list of thread groups where they will be scheduled to run. INITTASKs and CLOSETASKs that do not specify any thread groups are scheduled on all thread groups. TASKs that do not specify any thread groups are scheduled on the default thread group only. Thread groups not specified by any INITTASK, CLOSETASK, or TASK are ignored and not mapped to any threads.
Tasks using the same thread group can run concurrently with themselves and
each other, unless the global parameter Prms.serialExecution is true.
They are also typically be scheduled onto different client threads from one
execution to the next.
The timing, relative priority, and termination characteristics of tasks
within the thread group are handled separately using per-task and test-wide
attributes.
Thread Subgroup Parameters:
-- totalThreads (int) The total number of threads in one subgroup of the thread group.
-- totalVMs (int) (optional) The "totalThreads" threads for this thread subgroup are scattered as evenly as possible across the specified number of VMs. Omit this to allow the scheduler to use any number of VMs.
-- clientNames (comma-separated list of strings) (optional) The VMs used for this thread subgroup are chosen from VMs with the corresponding logical client name. Omit this to allow the scheduler to use any logical client types.
Sample usage scenarios:
-- To allow a set of tasks to compete for 5 fixed threads, set totalThreads=5 and assign those tasks to the thread group.
-- To run a given task exclusively in 1 thread in 5 VMs, set totalThreads=5 totalVMs=5 and assign only that task to the thread group.
-- To run Task A exclusively on 2 single-threaded VMs, Task B and Task C on 4 VMs with 25 threads each, and Task D exclusively on 1 thread in each of those same 4 VMs, define: hydra.ClientPrms-clientNames single multi; hydra.ClientPrms-vmQuantities 2 4; hydra.ClientPrms-vmThreads 1 26; THREADGROUP ForTaskA totalThreads=2 totalVMs=2 clientNames=single; THREADGROUP ForTaskBC totalThreads=100 totalVMs=4 clientNames=multi; THREADGROUP ForTaskD totalThreads=4 totalVMs=4 clientNames=multi; Then assign each task to the appropriate thread group.
-- To include an exclusive thread running Task D on Task A's VMs, define: hydra.ClientPrms-clientNames single multi; hydra.ClientPrms-vmQuantities 2 4; hydra.ClientPrms-vmThreads 2 26; THREADGROUP ForTaskA totalThreads=2 totalVMs=2 clientNames=single; THREADGROUP ForTaskBC totalThreads=100 totalVMs=4 clientNames=multi; THREADGROUP ForTaskD totalThreads=6 totalVMs=6 clientNames=single,multi; Then assign each task to the appropriate thread group.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NAME
Name of the default thread group
|
| Constructor and Description |
|---|
HydraThreadGroup(String s)
Create a hydra thread group with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubgroup(HydraThreadSubgroup subgroup)
Adds a subgroup to this thread group.
|
String |
getName()
Gets the name of this thread group.
|
HydraThreadSubgroup |
getSubgroup(int i)
Gets the i'th subgroup that makes up this thread group.
|
Vector |
getSubgroups()
Gets the subgroups that make up this thread group.
|
int |
getTotalThreads()
Gets the total number of threads in this thread group (lazily).
|
SortedMap |
toSortedMap() |
String |
toString() |
Boolean |
usesCustomWeights()
Gets whether the tasks that use this thread group use custom weights.
|
void |
usesCustomWeights(Boolean b)
Sets whether the tasks that use this thread group use custom weights.
|
public static final String DEFAULT_NAME
public HydraThreadGroup(String s)
public String getName()
public Boolean usesCustomWeights()
public void usesCustomWeights(Boolean b)
public Vector getSubgroups()
public HydraThreadSubgroup getSubgroup(int i)
public void addSubgroup(HydraThreadSubgroup subgroup)
public int getTotalThreads()
public SortedMap toSortedMap()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.