Hi Durga, One way would be to keep those stats in an actor, and have a branch that sends that data to it.
Something like this: val statsActorSink = Sink.actorRef(refToStatsActor, Done) regularSource.alsoTo(statsActorSink).via(regularProcessingFlow).to(regularSink) This will send every event in the stream to the actor for calculating stats. You can then query that actor or periodically publish the stats somewhere from it depending on what you need. -- Johan Andrén Akka Team, Lightbend Inc. On Friday, April 29, 2016 at 10:08:47 AM UTC+2, Durga Prasana wrote: > > Hi, > > We're using akka-streams to process a stream of messages, which result in > some actions. > Now, we need to find the number of messages being processed by the stream > (well, not that plain vanilla, actually each message has a set of > attributes, say, m_type, m_cmp, m_origin, ...). > > One solution would be to have a counter in one of the stages that would > keep track of that & update. > Other I'm hinted from the akka-docs could be the `M` materialized values > of the stream (that we seldom use currently). However, I'm not so sure, how > to start a runnable-graph once, & then keep on invoking the materialized > value at each interval of let's say 5 mins (to kind of find messages > processed so far) ? > > > We need the stream running continuously, so, doing a someGraph.run again > and again doesn't make sense to find the materialized value at various > intervals. > > http://doc.akka.io/docs/akka/2.4.4/scala/stream/stream-quickstart.html#reactive-tweets > > Would be thankful for some guidance here. > > Thanks, > Durga > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.