All Projects → ruippeixotog → akka-stream-mon

ruippeixotog / akka-stream-mon

Licence: MIT license
Throughput and latency monitoring for Akka Streams

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to akka-stream-mon

Alpakka Kafka
Alpakka Kafka connector - Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
Stars: ✭ 1,295 (+5530.43%)
Mutual labels:  akka, reactive-streams
alpakka-samples
Example projects building Reactive Integrations using Alpakka
Stars: ✭ 61 (+165.22%)
Mutual labels:  akka, reactive-streams
akka-cookbook
提供清晰、实用的Akka应用指导
Stars: ✭ 30 (+30.43%)
Mutual labels:  akka, reactive-streams
Reactive Serial
Reactive Streams API for Serial Communication
Stars: ✭ 24 (+4.35%)
Mutual labels:  akka, reactive-streams
Alpakka
Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
Stars: ✭ 1,154 (+4917.39%)
Mutual labels:  akka, reactive-streams
Toketi Iothubreact
Akka Stream library for Azure IoT Hub
Stars: ✭ 36 (+56.52%)
Mutual labels:  akka, reactive-streams
Akka Grpc
Akka gRPC
Stars: ✭ 361 (+1469.57%)
Mutual labels:  akka, reactive-streams
Clickhouse Scala Client
Clickhouse Scala Client with Reactive Streams support
Stars: ✭ 84 (+265.22%)
Mutual labels:  akka, reactive-streams
Kmq
Kafka-based message queue
Stars: ✭ 239 (+939.13%)
Mutual labels:  akka, reactive-streams
Akka.Logger.Serilog
Akka.NET logging integration for Serilog library
Stars: ✭ 22 (-4.35%)
Mutual labels:  akka
ainterface
Runs an Erlang node on an ActorSystem of Akka.
Stars: ✭ 44 (+91.3%)
Mutual labels:  akka
akka-cqrs-activator
Issue tracker PoC application written in Scala (Akka) and JavaScript (React) that demonstrates event sourcing and CQRS
Stars: ✭ 33 (+43.48%)
Mutual labels:  akka
akka-persistence-foundationdb
A replicated Akka Persistence journal backed by FoundationDB
Stars: ✭ 43 (+86.96%)
Mutual labels:  akka
spring-demo
Demo application for Netifi Proteus and RSocket. The guideline is available here ->
Stars: ✭ 24 (+4.35%)
Mutual labels:  reactive-streams
endless
Scala library to describe sharded and event sourced entities using tagless-final algebras
Stars: ✭ 70 (+204.35%)
Mutual labels:  akka
async
⏱ Promises and reactive-streams in Swift built for high-performance and scalability.
Stars: ✭ 35 (+52.17%)
Mutual labels:  reactive-streams
akka-cluster-sample
A sample Akka Cluster application that uses ZooKeeper for service discovery
Stars: ✭ 13 (-43.48%)
Mutual labels:  akka
telepooz
Functional Telegram Bot API wrapper for Scala on top of akka, circe, cats, and shapeless
Stars: ✭ 26 (+13.04%)
Mutual labels:  akka
protoactor-python
Proto Actor - Ultra fast distributed actors
Stars: ✭ 78 (+239.13%)
Mutual labels:  akka
lila-ws
Lichess' websocket server
Stars: ✭ 99 (+330.43%)
Mutual labels:  akka

akka-stream-mon Build Status Maven Central

A small library containing graph stages to measure the latency and throughput of Akka Streams.

Usage

To use akka-stream-mon in an existing SBT project with Scala 2.12, add the following dependency to your build.sbt:

libraryDependencies += "net.ruippeixotog" %% "akka-stream-mon" % "0.1.0"

Throughput

A ThroughputMonitor measures the throughput at a given link in a graph. Graphically, it looks like this:

+--------+    +-------------------+     +------+
| Source +----> ThroughputMonitor +-----> Sink |
+--------+    +---------+---------+     +------+
                        |
                        |
                    +---v---+
                    | Stats |
                    +-------+

In their simplest form, throughput monitors can be set up like this:

// monitor the throughput at the `source`-`sink` link, emitting stats to
// `statsSink`
source.via(ThroughputMonitor(statsSink)).to(sink)

// monitor the throughput at the `source`-`sink` link, calling
// `onStatsHandler` with stats every 5 seconds
source.via(ThroughputMonitor(5.seconds, onStatsHandler)).to(sink)

In more complex graphs, with the help of the GraphDSL, the monitor can be used as a graph stage with in and out ports for the link to be measured and an additional statsOut emitting stats. With statsOut connected using any of the ways shown above, this stage looks and acts just like a no-op Flow (a Flow letting all elements flow untouched).

Latency

A LatencyMonitor measures the throughput of a linear segment (Flow) of a graph. Graphically, it looks like this:

              +----------------+
              | LatencyMonitor |
+--------+    |    +------+    |    +------+
| Source +---------> Flow +---------> Sink |
+--------+    |    +------+    |    +------+
              |                |
              +--------+-------+
                       |
                   +---v---+
                   | Stats |
                   +-------+

In order for latency measures to be meaningful, the Flow being measured is required by this stage to:

  • emit exactly one element for each one that it consumes (i.e. it doesn't aggregate, filter or unfold elements, it just transforms them);
  • emits elements the in the same order it consumes them.

This happens because LatencyMonitor doesn't mark or modify elements in any way to recognize them individually on both endpoints; it just monitors the flow on each side and relies on the 1-to-1 mapping to deduce latencies.

In their simplest form, latency monitors can be set up like this:

// monitor the latency of `flow`, emitting stats to `statsSink`
source.via(LatencyMonitor(flow, statsSink)(Keep.right)).to(sink)

// monitor the latency of `flow`, calling `onStatsHandler` with stats every
// 5 seconds
source.via(LatencyMonitor(flow, 5.seconds, onStatsHandler)).to(sink)

In more complex graphs, with the help of the GraphDSL, the monitor can be used as a graph stage that wraps a flow, providing in and out ports connected to the flow ports, while providing an additional statsOut emitting stats. With statsOut connected using any of the ways shown above, this stage looks and acts just like the flow it monitors.

Copyright

Copyright (c) 2018 Rui Gonçalves. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].