Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O1 update #44

Open
wants to merge 32 commits into
base: aide-oms
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
78bbcd1
Add prompts and requirements, improve code and tests
peter-lawrey Dec 17, 2024
4b61dbd
Add prompts and requirements, improve code and tests
peter-lawrey Dec 17, 2024
e06a8f7
Add prompts and requirements, improve code and tests
peter-lawrey Dec 17, 2024
11d0666
Add prompts and requirements, improve code and tests
peter-lawrey Dec 17, 2024
de57cff
Add a mermaid diagram
peter-lawrey Dec 17, 2024
dcb0bd3
Add a mermaid diagram
peter-lawrey Dec 17, 2024
c80a793
Added tests
peter-lawrey Dec 17, 2024
87b7573
Fix Javadoc
peter-lawrey Dec 17, 2024
ea4b24d
Second iteration of review
peter-lawrey Dec 18, 2024
7b3670d
First phase updates
peter-lawrey Jan 1, 2025
3847538
don't include context.asciidoc
peter-lawrey Jan 1, 2025
fc3640b
Second Phase - Adding tests
peter-lawrey Jan 1, 2025
1569cdf
Create test-requirements.adoc
peter-lawrey Jan 1, 2025
f365c5f
Second Phase - Update tests
peter-lawrey Jan 1, 2025
18e1675
Second Phase - Update tests
peter-lawrey Jan 1, 2025
93fdb12
TBD
peter-lawrey Jan 1, 2025
accc4cf
Improve reference to the FIX spec
peter-lawrey Jan 1, 2025
50dee91
Improve reference to the FIX spec
peter-lawrey Jan 1, 2025
70c0c00
Improve reference to the FIX spec
peter-lawrey Jan 1, 2025
c36df0c
Updated README.adoc links
peter-lawrey Jan 1, 2025
a3dbb9f
First phase updates
peter-lawrey Jan 1, 2025
a3bdf13
Updated requirements and adoc
peter-lawrey Jan 2, 2025
69cfe7a
Removed AIDE
peter-lawrey Jan 2, 2025
8041968
ch hello-world
peter-lawrey Jan 2, 2025
22840bc
Uncomment
peter-lawrey Jan 2, 2025
c01b96a
First Phase - Generate requirements
peter-lawrey Jan 1, 2025
4de57f5
First phase updates
peter-lawrey Jan 1, 2025
a1f8928
Not needed
peter-lawrey Jan 2, 2025
a52b961
Not needed
peter-lawrey Jan 2, 2025
2da0283
Merge branch 'aide-oms' into o1-update
peter-lawrey Jan 2, 2025
dca9402
Update project en-GB
peter-lawrey Jan 2, 2025
da336e1
Update the account example
peter-lawrey Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Temporarily exclude these files from aide to make the token size manageable
#account/
#order-processor/

### How to update
# This is copied from OpenHFT/.gitignore
# update the original and run OpenHFT/update_gitignore.sh
Expand Down
63 changes: 54 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
= Chronicle-Queue-Demo
Peter Lawrey
:imagesdir: images
= Chronicle Queue Demo - README
:toc:
:toclevels: 3

This is a tutorial demonstrating the usage of Chronicle Queue with simple demo programs.
This repository demonstrates the usage of Chronicle Queue (and related Chronicle libraries) through multiple examples, including an order processor, event routing, and more. Below is a quick start and pointers to further documentation.

== Quick Start

.Basic Steps
----
git clone https://github.com/OpenHFT/Chronicle-Queue-Demo.git
cd Chronicle-Queue-Demo
mvn clean install
----

To run a simple example, like the hello-world module:

----
cd hello-world
mvn install exec:java@RecordInputToConsoleMain
----

== Documentation

The project’s documentation is consolidated in five AsciiDoc files:

1. xref:architecture.adoc[Architecture]
2. xref:usage-and-tests.adoc[Usage & Tests]
3. xref:reference.adoc[Reference, Style & Glossary]
4. xref:account/README.adoc[Account Management System (AMS)]
5. xref:order-processor/README.adoc[Order Processor]

Refer to them for details on architecture, usage instructions, testing approaches, style guides, and advanced references.

== Repository Overview

The modules in this repository include:

* **account**: An Account Management System (AMS) example using Chronicle Queue event-driven logic.
* **benchmarks**: Scripts and classes demonstrating throughput/latency benchmarks (e.g., LatencyDistributionMain, ThroughputMain).
* **event-routing**: Showcases how messages can be routed via Chronicle Queues with interfaces like `ViaIn`, `ViaOut`.
* **hello-world**: A simple introduction to an event-driven microservice using Chronicle Queue (input, exclamation addition, output).
* **md-pipeline**: A Market Data pipeline example with aggregator, strategy, and an exchange simulator.
* **message-history-demo**: Demonstrates Chronicle’s `MessageHistory` in bridging or event processing scenarios.
* **messages-with-text**: An example of writing/reading textual content with minimal garbage creation.
* **order-processor**: A submodule that acts as a simple OMS (Order Management System), referencing FIX 4.2 concepts.

For deeper details on each, see xref:architecture.adoc[Architecture].

== Order Processor

image::Two-hop-latency.PNG[]
This is a tutorial demonstrating the usage of Chronicle Queue with simple demo programs.

image::images/Two-hop-latency.png[]

You can find the source code for the order processor example https://github.com/OpenHFT/Chronicle-Queue-Demo/tree/master/order-processor[here].

Expand All @@ -18,13 +63,13 @@ This allows you to install Linux packages that aren't already on Windows.
When this asks you which packages you want to install, search for and add `git`.
This is under `Development` and you need to click `skip` so it says to `install`.

image::gitpack.png[]
image::images/gitpack.png[]

Open IntelliJ or your favorite https://en.wikipedia.org/wiki/Integrated_development_environment[Integrated Development Environment (IDE)]. If you haven't installed an IDE, we recommend https://www.jetbrains.com/idea/download/#section=windows[IntelliJ], which we'll use for this tutorial.

In IntelliJ, select `Get from VCS` to clone the Chronicle Queue Sample code.

image::homegit.png[]
image::images/homegit.png[]

Then, copy the following URL into the `Git Repository URL` field and remember the `Parent Directory`. Click `Clone` to get the code.

Expand All @@ -33,11 +78,11 @@ Then, copy the following URL into the `Git Repository URL` field and remember th
https://github.com/OpenHFT/Chronicle-Queue-Demo.git
----

image::Clone.PNG[]
image::images/Clone.png[]

If you close the project, you can reopen it by going to `File -> Open`. You'll find the repository in the directory where you saved it.

image::directory.PNG[]
image::images/directory.png[]

Now you're ready to run the example programs! You can start with https://github.com/OpenHFT/Chronicle-Queue-Demo/tree/master/simple-input[Simple Input].

Expand Down
63 changes: 63 additions & 0 deletions account.ad
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
= Project Summary

== Overview

The project is an Account Management System (AMS) leveraging the Chronicle libraries for high-performance, low-latency event-driven operations. It emphasizes documentation-driven development with AI integration for streamlined engineering. The AMS manages account creation, transfers, and state snapshots through a comprehensive suite of YAML-based tests, detailed functional requirements, and a modular architecture.

== Key Features

* **Low-Latency and High-Throughput**: Designed for operations with microsecond-level latencies and over 1M messages per second throughput.
* **Event-Driven Design**: Utilizes Chronicle Queue for durable message persistence and asynchronous operations.
* **Rich Documentation**: Implements AsciiDoc for capturing requirements, workflows, and style guides to align development with AI tools.
* **Testing Framework**: YAML-driven scenarios test various operations, including edge cases and invalid inputs, ensuring robust functionality.

== Functional Components

=== Documentation
* **AIDE Glossary**: Defines project-specific terminology, such as AIDE (Artificial Intelligence Development Environment) and tokens/line ratios.
* **Style Guide**: Enforces British English conventions and standardizes coding/documentation practices.
* **Workflow**: Outlines iterative development—document, test, code, review, and repeat—keeping code and requirements synchronized.

=== Code
* **Core Classes**:
* `AccountManagerImpl`: Orchestrates incoming events and delegates logic to `AccountService`.
* `AccountService`: Validates accounts, manages balances, and processes transfers.
* DTOs (e.g., `CreateAccount`, `Transfer`): Represent operations with fluent setter methods for chaining.
* **Utilities**:
* `LogsAccountManagerOut`: A mock implementation for testing event outputs.
* `ErrorListener`: Handles JVM-level errors gracefully.

=== Testing
* **Parameterized Tests**: YAML scenarios validate the AMS against predefined inputs and outputs.
* **Coverage**:
* Account creation, transfers, checkpoints.
* Edge cases, including invalid currencies, missing fields, and insufficient funds.
* Performance benchmarks using JLBH for latency testing.

=== Benchmark Results
Demonstrated latencies:

* Shared Memory: ~1.5 µs
* TCP: ~20 µs
* End-to-End Variance: Minimal under high load conditions.

== Directories and Files

All directories here are under `account` directory

=== Code
* `src/main/java`: Implementation of AMS.
* `AccountManagerImpl.java`: Main orchestration logic.
* `AccountService.java`: Domain operations.

=== Tests
* `src/test/java`: Unit and integration tests.
* YAML files: Input (`in.yaml`), expected output (`out.yaml`), and setup (`_setup.yaml`) configurations.

=== Utilities
* `list_files_asciidoc.sh`: Script to generate directory content summaries.
* `benchmark-results.txt`: Performance insights.

== Summary

The AMS is a modular, high-performance system underpinned by comprehensive documentation, rigorous testing, and cutting-edge Chronicle technologies. This structure ensures maintainability, scalability, and alignment with evolving requirements.
Loading