Members
(constant) BATCH
Batch-style workload, where the think-time is 0; after a request is served it goes right back in the system without waiting.
(constant) MSC
A Multi-server closed queue (M/M/m/N/N). Uses the FESC (flow equivalent service center) algorithm.
(constant) TERM
Terminal-style workload, where users have a non-zero think time.
Methods
createClosed(name, shouldBeClass, N, Z)
Creates a closed queuing workload with a given number of users, a think time, and either BATCH or TERM class.
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The name to give the workload. |
shouldBeClass |
Workload
|
The worload class, either pdq.BATCH or pdq.TERM. |
N |
number
|
The number of active users in the system. |
Z |
number
|
The average think time between requests for a user. |
createMultiNode(servers, name, deviceType, schedule)
Creates a multiserver (open or closed) queue.
Parameters:
Name | Type | Description |
---|---|---|
servers |
number
|
The number of servers. |
name |
string
|
The name of system. |
deviceType |
DeviceType
|
The kind of system, either pdq.MSO or pdq.MSC. |
schedule |
Discipline
|
The queueing schedule. |
createNode(name, device, schedule)
Creates a single queueing center in either a closed or open circuit
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The name of the queueing center. |
device |
DeviceType
|
The kind of center, open or closed. |
schedule |
Discipline
|
The queueing discipline. |
createOpen(name, lambda)
Creates an open queuing system with a given arrival rate.
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The name of the model. |
lambda |
number
|
The arrival rate. |
getComment()
Read a comment written into the model, if one was set earlier by setComment().
getLoadOpt(shouldBeClass, wName)
Returns the optimal user load for the specified workload
Parameters:
Name | Type | Description |
---|---|---|
shouldBeClass |
Workload
|
|
wName |
string
|
getNodesCount() → {number}
Get the number of created nodes.
Returns:
- Type:
-
number
The number of created nodes
getQueueLength(device, work, shouldBeClass)
Get the average queue length of a device.
Parameters:
Name | Type | Description |
---|---|---|
device |
string
|
The device name |
work |
string
|
The workload |
shouldBeClass |
Workload
|
The type of the workload |
getResidenceTime(device, work, shouldBeClass)
Returns the device residence time for the specified workload
Parameters:
Name | Type | Description |
---|---|---|
device |
string
|
|
work |
string
|
|
shouldBeClass |
Workload
|
getResponse(shouldBeClass, wName)
Returns the system response time for the specified workload
Parameters:
Name | Type | Description |
---|---|---|
shouldBeClass |
Workload
|
either TERM, TRANS or BATCH. |
wName |
string
|
the name of the workload |
getStreamCount() → {number}
Get the number of created streams.
Returns:
- Type:
-
number
The number of created streams
getThruMax(shouldBeClass, wName)
Get the maximum throughput of a workload
Parameters:
Name | Type | Description |
---|---|---|
shouldBeClass |
Workload
|
The type of the workload. |
wName |
string
|
The name of the workload. |
getThruput(shouldBeClass, wName)
Returns the system throughput for the specified workload
Parameters:
Name | Type | Description |
---|---|---|
shouldBeClass |
Workload
|
|
wName |
string
|
getUtilization(device, work, shouldBeClass)
Get the utilization of a device.
Parameters:
Name | Type | Description |
---|---|---|
device |
string
|
The device name |
work |
string
|
The name of the workload |
shouldBeClass |
Workload
|
The type of the workload |
init(name) → {string}
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The name of the model. |
Returns:
- Type:
-
string
the C return value
Example
pdq.init("MyModel")
// returns 2
/
/**
Call this to initialize PDQ before creating a model.
report()
Print the report. Currently goes to the console.log, but this will be fixed in
an upcoming release.
setComment(comment)
Add a comment to the report. Useful as a way to add a note to them model.
Parameters:
Name | Type | Description |
---|---|---|
comment |
string
|
setDebug(mode)
Set the debug mode on/off
Parameters:
Name | Type | Description |
---|---|---|
mode |
number
|
Either 1 or 0. |
setDemand(name, workload, time)
Set the demand ofload at a specified node a particular node
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The name of the node. |
workload |
string
|
The name of the workload. For example, "requests", or "customers". |
time |
number
|
The workload, eg 400 for 400 Requests per second. |
setTUnit(unitName)
Set the time unit.
Parameters:
Name | Type | Description |
---|---|---|
unitName |
string
|
The time unit, eg: minutes, seconds, hours, years. |
setVisits(nodeName, workName, visits, service)
Parameters:
Name | Type | Description |
---|---|---|
nodeName |
string
|
The name of the node on which to set the service demand. |
workName |
string
|
The name of the worload to set. |
visits |
number
|
The number of visits, in the work unit (eg 5 jobs). |
service |
number
|
The service time, in the time unit (eg per hour). |
setWUnit(unitName)
Set the work unit.
Parameters:
Name | Type | Description |
---|---|---|
unitName |
string
|
The work unit, eg: jobs, customers, orders. |
solve(method)
Solve the model for its characteristics, passing in the intended solving method.
Parameters:
Name | Type | Description |
---|---|---|
method |
SolutionMethod
|
The method to use to calculate the solution. |