All PDQ development is now taking place on Source Forge at http://sourceforge.net/projects/pdq-qnm-pkg/ (Pretty Damn Quick Queueing Model Package)
| PDQ_Init() | Initializes all internal PDQ variables. Must be called prior to any other PDQ function. |
| PDQ_CreateOpen() | Defines the characteristics of a workload in an open-circuit queueing model. |
| PDQ_CreateClosed() | Defines the characteristics of a workload in a closed-circuit queueing model. |
| PDQ_CreateNode() | Defines a single queueing-center in either a closed or open circuit queueing model. |
| PDQ_SetDemand() | Defines the service demand of a specific workload at a specified node. |
| PDQ_SetVisits() | Define the service demand in terms of the service time and visit count. |
| PDQ_SetDebug() | enables diagnostic printout of PDQ internal variables. |
| PDQ_Solve() | The solution method must be passed as an argument. |
| PDQ_GetResponse() | Returns the system response time for the specified workload. |
| PDQ_GetThruput() | Returns the system throughput for the specified workload. |
| PDQ_GetUtilization() | Returns the utilization of the designated queueing node by the specified workload. |
| PDQ_Report()s | Generates a formatted report containing system, and node level performance measures. |
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "../lib/PDQ_Lib.h"
main()
{
// PDQ global variables
extern int nodes;
extern int streams;
// Model specific variables
double arrival_rate = 0.5;
double service_time = 1.0;
// Initialize PDQ and the model a name
PDQ_Init("M/M/1");
// Change metric labels
PDQ_SetWUnit("Customer");
PDQ_SetTUnit("Minute");
// Create the M/M/1 queue
nodes = PDQ_CreateNode("Server", CEN, FCFS);
// Define the workload and circuit type
streams = PDQ_CreateOpen("Customers", arrival_rate);
// Define service demand due to workload on the queueing center
PDQ_SetDemand("Server", "Customers", service_time);
// Solve the model
PDQ_Solve(CANON);
// Generate a standard report
PDQ_Report();
}
This might look like a lot of C code for such a simple model, but realize
that most of the code is for initialization and other set-up. When
amortized over more realistic computer models, it becomes a much smaller
fraction of the total code. Note also, that some dozen lines of comments
have been added to assist you in reading this particular model.
***************************************
****** Pretty Damn Quick REPORT *******
***************************************
*** of : Sat Oct 20 14:52:25 2001 ***
*** for: M/M/1 ***
*** Rel: PDQ Analyzer v2.5 082401 ***
***************************************
***************************************
****** Comments *******
This is just a simple M/M/1 queue.
***************************************
****** PDQ Model INPUTS *******
***************************************
Node Sched Resource Workload Class Demand
---- ----- -------- -------- ----- ------
CEN FCFS Server Customers TRANS 1.0000
Queueing Circuit Totals:
Generators: 0.00
Streams : 1
Nodes : 1
WORKLOAD Parameters
Srcs per Sec Demand
-------- ------- ------
Customers 0.5000 1.0000
***************************************
****** PDQ Model OUTPUTS *******
***************************************
Solution Method: CANON
****** SYSTEM Performance *******
Metric Value Unit
----------------- ----- ----
Workload: "Customers"
Mean Throughput 0.5000 Customer/Minute
Response Time 2.0000 Minute
Bounds Analysis:
Max Throughput 1.0000 Customer/Minute
****** RESOURCE Performance *******
Metric Resource Work Value Unit
--------- ------ ---- ----- ----
Throughput Server Customers 0.5000 Customer/Minute
Utilization Server Customers 50.0000 Percent
Queue Length Server Customers 1.0000 Customer
Residence Time Server Customers 2.0000 Minute
We see that the PDQ results are in complete agreement with those previously
calculated by hand using the M/M/1 formulae 4.1. A more
detailed discussion is presented in Chapters 2 and 3 of
The Practical Performance Analyst.