# ot4i/perf-harness architecture

> Architecture diagram of the GitHub repository ot4i/perf-harness, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ot4i/perf-harness
- Repository: https://github.com/ot4i/perf-harness

## Overview

##### Project type and purpose
- This is an open-source, modular Java performance-testing tool (“Perfharness”) that can drive load against HTTP endpoints, JMS brokers (JMS 1.1 & 2.0), IBM MQ (Java & JMS), TCP/IP and other transports.
- It is not a web-application but a command-line library/framework: you invoke a main class with parameters, it spawns threads, drives messages/requests, gathers statistics, and reports results.

##### File structure
- Top-level Eclipse projects:
- PerfHarness – the core engine and common services (configuration loading, threading, stats, sequencing, command processing)
- HTTPPerfHarness – HTTP transport plug-in (GET, POST, PUT, SOAP, SSL)
- JMSPerfHarness – JMS 1.1 module with multiple provider implementations (WebSphereMQ, QPID, WMB, etc.)
- JakartaJMSPerfHarness – JMS 2.0 module using Jakarta APIs
- MQJavaPerfHarness – pure IBM MQ Java API module
- PerfHarnessPrereqs – external JAR dependencies (IBM MQ client jars, JNDI, connector, etc.)
- samples, docs, build scripts and Ant files under PerfHarness
- Each transport module follows the same package hierarchy:
com.ibm.uk.hursley.perfharness.<transport>
with Provider, Requestor, configuration (`.properties`) and optional sub-packages (r11, r20, cmd, tcpip).
- The core PerfHarness project contains:
- Config, ControlThread, WorkerThread, ApplicationPropertyMap
- cmd sub-package for pluggable command processors (Socket, LinuxPipe, Dummy)
- sequencing, stats, util sub-packages for pluggable sequencing and statistics collectors
- Build/CI artifacts: Ant build.xml files in each project, sample run-config XMLs, and generated JARs under `build/`.

##### README for additional insights
- Describes the four build targets (HTTP, JMS, Jakarta JMS, MQ), prerequisites per module, and how to run from Eclipse or command line.
- Emphasizes modular plug-in architecture and configurable transports via properties and class-path.

##### Detail without over-splitting
- Every major package boundary (core vs. module)
- Threading boundary (ControlThread vs. WorkerThreads)
- Property/configuration injection points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% CLI Launcher
    CLI["CLI Launcher\n(JMSPerfHarnessMain)"]:::core
    click CLI "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/JMSPerfHarness.java"

    %% Core Engine
    subgraph "Core Engine" 
        direction TB
        Config["Configuration Loader\nConfig.java"]:::core
        click Config "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/Config.java"
        AppProps["ApplicationPropertyMap\nApplicationPropertyMap.java"]:::core
        click AppProps "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/ApplicationPropertyMap.java"
        Log["Logging\nLog.java"]:::core
        click Log "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/Log.java"
        DDF["DefaultDestinationFactory\nDefaultDestinationFactory.java"]:::core
        click DDF "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfhurs/pharness/DefaultDestinationFactory.java"
        Control["ControlThread\nControlThread.java"]:::core
        click Control "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/ControlThread.java"
        Worker["WorkerThreads\nWorkerThread.java"]:::core
        click Worker "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/WorkerThread.java"
        Util["Utility Classes"]:::core
        click Util "https://github.com/ot4i/perf-harness/tree/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/util/"
        %% Command Processors
        subgraph "Command Processors"
            direction TB
            Dummy["DummyCommandProcessor"]:::core
            click Dummy "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/cmd/DummyCommandProcessor.java"
            SocketCP["SocketCommandProcessor"]:::core
            click SocketCP "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/cmd/SocketCommandProcessor.java"
            LinuxCP["LinuxPipeCommandProcessor"]:::core
            click LinuxCP "https://github.com/ot4i/perf-harness/blob/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/cmd/LinuxPipeCommandProcessor.java"
        end
        %% Sequencing & Stats
        Seq["Sequencing Module"]:::core
        click Seq "https://github.com/ot4i/perf-harness/tree/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/sequencing/"
        Stats["Statistics Module"]:::core
        click Stats "https://github.com/ot4i/perf-harness/tree/main/PerfHarness/src/com/ibm/uk/hursley/perfharness/stats/"
        %% Reporting
        Report["Reporting\n(Console, Files)"]:::core
    end

    %% Transport Plug-ins
    subgraph "HTTP Module" 
        direction TB
        HTTPProv["HTTPProvider.java"]:::transport
        click HTTPProv "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/http/HTTPProvider.java"
        HTTPReq["HTTPRequestor.java"]:::transport
        click HTTPReq "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/http/HTTPRequestor.java"
        HTTPImpl["GET/POST/PUT"]:::transport
        click HTTPImpl "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/http/HTTPGetURL.java"
        click HTTPImpl "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/http/HTTPPostURL.java"
        click HTTPImpl "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/http/HTTPPutURL.java"
        subgraph "TCP/IP Submodule"
            direction TB
            TCPProv["TCPIPProvider.java"]:::transport
            click TCPProv "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/tcpip/TCPIPProvider.java"
            TCPReq["TCPIPRequestor.java"]:::transport
            click TCPReq "https://github.com/ot4i/perf-harness/blob/main/HTTPPerfHarness/src/com/ibm/uk/hursley/perfharness/tcpip/TCPIPRequestor.java"
        end
    end

    subgraph "JMS 1.1 Module"
        direction TB
        JMSProv["JMSProvider"]:::transport
        click JMSProv "https://github.com/ot4i/perf-harness/blob/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/providers/JMSProvider.java"
        JMSMsgFactory["DefaultMessageFactory"]:::transport
        click JMSMsgFactory "https://github.com/ot4i/perf-harness/blob/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/DefaultMessageFactory.java"
        subgraph "r11"
            Requestor11["Requestor.java"]:::transport
            click Requestor11 "https://github.com/ot4i/perf-harness/blob/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r11/Requestor.java"
            Worker11["JMS11WorkerThread.java"]:::transport
            click Worker11 "https://github.com/ot4i/perf-harness/blob/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r11/JMS11WorkerThread.java"
        end
        subgraph "Providers"
            direction TB
            JMSProviders["Various Providers"]:::transport
            click JMSProviders "https://github.com/ot4i/perf-harness/tree/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/providers/"
        end
        subgraph "r20"
            Requestor20["Requestor.java"]:::transport
            click Requestor20 "https://github.com/ot4i/perf-harness/blob/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r20/Requestor.java"
            Worker20["JMS20WorkerThread.java"]:::transport
            click Worker20 "https://github.com/ot4i/perf-harness/blob/main/JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r20/JMS20WorkerThread.java"
        end
    end

    subgraph "Jakarta JMS Module"
        direction TB
        JProv["JMSProvider"]:::transport
        click JProv "https://github.com/ot4i/perf-harness/blob/main/JakartaJMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/providers/JMSProvider.java"
        JMsgFactory["DefaultMessageFactory"]:::transport
        click JMsgFactory "https://github.com/ot4i/perf-harness/blob/main/JakartaJMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/DefaultMessageFactory.java"
        subgraph "r11"
            JReq11["Requestor.java"]:::transport
            click JReq11 "https://github.com/ot4i/perf-harness/blob/main/JakartaJMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r11/Requestor.java"
            JWrk11["JMS11WorkerThread.java"]:::transport
            click JWrk11 "https://github.com/ot4i/perf-harness/blob/main/JakartaJMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r11/JMS11WorkerThread.java"
        end
        subgraph "r20"
            JReq20["Requestor.java"]:::transport
            click JReq20 "https://github.com/ot4i/perf-harness/blob/main/JakartaJMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r20/Requestor.java"
            JWrk20["JMS20WorkerThread.java"]:::transport
            click JWrk20 "https://github.com/ot4i/perf-harness/blob/main/JakartaJMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r20/JMS20WorkerThread.java"
        end
    end

    subgraph "IBM MQ Java Module"
        direction TB
        MQProv["MQProvider"]:::transport
        click MQProv "https://github.com/ot4i/perf-harness/blob/main/MQJavaPerfHarness/src/com/ibm/uk/hursley/perfharness/mqjava/MQProvider.java"
        MQWrk["MQJavaWorkerThread"]:::transport
        click MQWrk "https://github.com/ot4i/perf-harness/blob/main/MQJavaPerfHarness/src/com/ibm/uk/hursley/perfharness/mqjava/MQJavaWorkerThread.java"
        MQCmd["MQCommandProcessor"]:::transport
        click MQCmd "https://github.com/ot4i/perf-harness/blob/main/MQJavaPerfHarness/src/com/ibm/uk/hursley/perfharness/cmd/MQCommandProcessor.java"
    end

    %% External Dependencies
    Prereqs["PerfHarnessPrereqs"]:::prereq
    click Prereqs "https://github.com/ot4i/perf-harness/tree/main/PerfHarnessPrereqs/"

    %% External Systems
    subgraph "External Systems"
        direction TB
        HTTPServer[(HTTP Server)]:::external
        JMSBroker[(JMS Broker)]:::external
        MQQM[(IBM MQ Queue Manager)]:::external
        TCPEnd[(TCP/IP Endpoint)]:::external
    end

    %% Connections
    CLI -->|"invokes"| Config
    Config -->|loads| AppProps
    AppProps -->|initializes| Control
    Control -->|spawns| Worker
    Worker -->|"uses"| HTTPReq
    Worker -->|"uses"| Requestor11
    Worker -->|"uses"| Requestor20
    Worker -->|"uses"| JReq11
    Worker -->|"uses"| JReq20
    Worker -->|"uses"| MQProv
    HTTPReq -->|sends/receives| HTTPServer
    TCPReq -->|sends/receives| TCPEnd
    Requestor11 -->|sends/receives| JMSBroker
    Requestor20 -->|sends/receives| JMSBroker
    JReq11 -->|sends/receives| JMSBroker
    JReq20 -->|sends/receives| JMSBroker
    MQWrk -->|sends/receives| MQQM
    Worker -->|reports to| Stats
    Stats -->|aggregates| Report
    Worker -->|orders via| Seq
    Seq -->|feeds| Report

    %% Styles
    classDef core fill:#bbdefb,stroke:#0d47a1,color:#0d47a1;
    classDef transport fill:#c8e6c9,stroke:#256029,color:#256029;
    classDef external fill:#ffe0b2,stroke:#e65100,color:#e65100;
    classDef prereq fill:#e0e0e0,stroke:#424242,color:#424242;
```
