|
| 1 | +# ML Performance Characterization Repository |
| 2 | + |
| 3 | +Here you will find Performance Characterizations for the Mojaloop Services. |
| 4 | + |
| 5 | +## 1. High-Level Characterization Scenarios |
| 6 | + |
| 7 | +| High-level Scenario | Description | Documentation | Notes | |
| 8 | +|---|---|---|---| |
| 9 | +| 1. | FSPIOP Discovery | [./fspiop-discovery/README](./fspiop-discovery/README.md) | Done | |
| 10 | +| 2. | ~~FSPIOP Agreement~~ | | To Be Done | |
| 11 | +| 3. | ~~FSPIOP Transfers~~ | [./fspiop-transfers/README](./fspiop-transfers/README.md) | To Be Done | |
| 12 | +| 4. | ~~FSPIOP Discovery + Agreement + Transfers~~ | | To Be Done | |
| 13 | + |
| 14 | +### 2. Capturing End-to-end Metrics |
| 15 | + |
| 16 | +We have two approaches to capture the End-to-end metrics of a transaction. |
| 17 | + |
| 18 | +#### 2.1 Tracestate Headers |
| 19 | + |
| 20 | +The [Tracestate](https://github.com/mojaloop/mojaloop-specification/blob/master/fspiop-api/documents/Tracing%20v1.0.md#table-4--data-model-for-tracestate-list-member-values) header is part of the [Mojaloop Specification](https://github.com/mojaloop/mojaloop-specification/blob/master/fspiop-api/documents/Tracing%20v1.0.md) which conforms to the [W3C](https://github.com/mojaloop/mojaloop-specification/blob/master/fspiop-api/documents/Tracing%20v1.0.md#5-references) Tracing standards. |
| 21 | + |
| 22 | +As such we are able to take advantage of this header by propogating the following key-value pairs during the End-to-end transaction: |
| 23 | + |
| 24 | +| tracestate-key | tracestate-value | Notes | |
| 25 | +|---|---|---| |
| 26 | +| tx_end2end_start_ts | [timestamp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) | Generated by the Test-runner (i.e. K6) | |
| 27 | +| tx_callback_start_ts | [timestamp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) | Generated by the Payee Participant Simupator (e.g. when reciving the FSPIOP GET /parties Request) | |
| 28 | + |
| 29 | +Example header: `tracestate=tx_end2end_start_ts={{TIMESTAMP}}, tx_callback_start_ts={{TIMESTAMP}}` |
| 30 | + |
| 31 | +#### 2.2 WebScoket Subscriptions |
| 32 | + |
| 33 | +The Simulators (i.e. "Callback Handler Service") have been developed to support a simple WebSocket (WS) mechanism that allows the Test Executer (i.e. K6) to subscribe for Callback events. |
| 34 | + |
| 35 | +For example, let's take the FSPIOP GET /parties use-case. Here we have K6 subscribe to a Callback via a WS on the Payer Participant Simulator based on the following properties: |
| 36 | + |
| 37 | +1. The **TraceID** |
| 38 | +2. The HTTP **Operation** (i.e. PUT) |
| 39 | +3. The Party **ID** (i.e. MSDISN Number) |
| 40 | + |
| 41 | +This ensure that the K6 subscription-notification will be unique for each test. |
| 42 | + |
| 43 | +We gain two benefits by using this approach: |
| 44 | + |
| 45 | +1. The K6 Runner will only iterate once the current request is completed End-to-end which means that our execution strategy is closer to a real-work scenario. |
| 46 | +2. The K6 Runner will be able to report on the End-to-end duration and operations per second. |
| 47 | + |
| 48 | +The down-sides of this approach, is that it only works well when we have a single Payer Participant Simulator. Its possible that we can support scaling the Payer Participant Simulator by having the K6 Runners subscribe to multiple instances, but that is currently not supported. |
| 49 | + |
| 50 | +## 3. Types of tests |
| 51 | + |
| 52 | +| Test Type | Description | |
| 53 | +|---|---| |
| 54 | +| **Smoke** | Validates scripts works and that our target env/system performs adequately under minimal load. | |
| 55 | +| **Average-load** | Assess how the system performs under expected normal conditions. | |
| 56 | +| **Stress** | Assess how the system performs at its limits when load exceeds the expected average. | |
| 57 | +| **Spike** | Validates the behavior and survival of the system in cases of sudden, short, and massive increases in activity. | |
| 58 | +| **Breakpoint** | Gradually increase load to identify the capacity limits of the system. | |
| 59 | + |
| 60 | +[Reference](https://k6.io/docs/test-types/load-test-types/#different-tests-for-different-goals). |
| 61 | + |
| 62 | +## 4. Tools Used |
| 63 | + |
| 64 | +| Tool | Description | |
| 65 | +|---|---| |
| 66 | +| **ml-core-test-harness** | The [ml-core-test-harness](https://github.com/mojaloop/ml-core-test-harness) is a light-weight Docker-composed based test harness used by the Mojaloop community to execute Functional, and now Performance-Characterization tests | |
| 67 | +| **K6** | [Grafana k6](https://k6.io/docs/) is an open-source load testing tool. | |
| 68 | +| **Docker Compose** | [Docker Compose](https://docs.docker.com/compose/) is a tool for defining and running multi-container Docker applications. | |
0 commit comments