Skip to content

Commit

Permalink
feat: Uset cohort SDK in Banking App. Print some metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarek-kindred committed Jul 26, 2023
1 parent a960408 commit c577227
Show file tree
Hide file tree
Showing 68 changed files with 4,219 additions and 164 deletions.
197 changes: 190 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ dev.preload_db:
$(call pp,run preload_db...)
cargo run --bin preload_db -- $(args)

## dev.cohort_banking: 🧪 Runs Cohort with built-it replicator and executes banking transactions
## dev.cohort_banking: 🧪 Runs Cohort with built-in replicator and executes banking transactions
dev.cohort_banking:
$(call pp,run cohort_banking...)
cargo run --example cohort_banking --release -- $(args)

## dev.cohort_banking_with_sdk: 🧪 Runs an example of rust app "Cohort Banking" which use cohort_sdk.
dev.cohort_banking_with_sdk:
$(call pp,run cohort_banking...)
cargo run --example cohort_banking_with_sdk --release -- $(args)

## dev.histogram_decision_timeline_from_kafka: 🧪 Reads all decisions from kafka and prints processing timeline as csv
dev.histogram_decision_timeline_from_kafka:
$(call pp,histogram_decision_timeline_from_kafka...)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "cohort_banking"
name = "cohort_banking_example"
version = "0.0.1"
edition = "2021"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ use std::{env, sync::Arc, time::Duration};
use async_channel::Receiver;
use cohort::{
config_loader::ConfigLoader,
examples_support::queue_processor::QueueProcessor,
metrics::Stats,
model::requests::TransferRequest,
replicator::pg_replicator_installer::PgReplicatorStatemapInstaller,
replicator2::{cohort_replicator::CohortReplicator, cohort_suffix::CohortSuffix, service::ReplicatorService2},
state::postgres::{data_access::PostgresApi, database::Database},
};
use examples_support::{
cohort::queue_workers::QueueProcessor,
load_generator::{generator::ControlledRateLoadGenerator, models::StopType},
};

use examples_support::load_generator::{generator::ControlledRateLoadGenerator, models::StopType};
use metrics::model::{MicroMetrics, MinMax};
use rand::Rng;
use rust_decimal::{prelude::FromPrimitive, Decimal};
Expand Down
36 changes: 36 additions & 0 deletions examples/cohort_banking_with_sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[package]
name = "cohort_banking_with_sdk"
version = "0.0.1"
edition = "2021"

[dev-dependencies]

cohort_sdk = { path = "../../packages/cohort_sdk" }
cohort_banking = { path = "../../packages/cohort_banking" }
examples_support = { path = "../../packages/examples_support" }
metrics = { path = "../../packages/metrics" }
talos_agent = { path = "../../packages/talos_agent" }
talos_certifier = { path = "../../packages/talos_certifier" }
talos_certifier_adapters = { path = "../../packages/talos_certifier_adapters" }
talos_suffix = { path = "../../packages/talos_suffix" }

async-trait = { workspace = true }
env_logger = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["full"] }

async-channel = { version = "1.8.0" }
deadpool-postgres = { version = "0.10" }
opentelemetry_api = { version = "0.19.0" }
opentelemetry_sdk = { version = "0.19.0", features = ["metrics", "rt-tokio"] }
opentelemetry = { version = "0.19.0" }
opentelemetry-prometheus = { version = "0.12.0", features = ["prometheus-encoding"] }
rand = { version = "0.8.5" }
rdkafka = { version = "0.29.0", features = ["sasl"] }
rdkafka-sys = { version = "4.3.0" }
rust_decimal = { version = "1.30.0", features = ["db-tokio-postgres", "serde-with-float"] }
time = { version = "0.3.17" }
tokio-postgres = { version = "0.7", features = [ "with-uuid-1", "with-serde_json-1" ] }
uuid = { version = "1.2.2", features = ["v4"] }
Loading

0 comments on commit c577227

Please sign in to comment.