the-algorithm/src/scala/com/twitter/recos/graph_common/FinagleStatsReceiverWrapper.scala
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
2023-03-31 17:36:31 -05:00

17 lines
664 B
Scala

package com.twitter.recos.graph_common
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.graphjet.stats.{StatsReceiver => GraphStatsReceiver}
/**
* FinagleStatsReceiverWrapper wraps Twitter's Finagle StatsReceiver.
*
* This is because GraphJet is an openly available library which does not
* depend on Finagle, but tracks stats using a similar interface.
*/
case class FinagleStatsReceiverWrapper(statsReceiver: StatsReceiver) extends GraphStatsReceiver {
def scope(namespace: String) = new FinagleStatsReceiverWrapper(statsReceiver.scope(namespace))
def counter(name: String) = new FinagleCounterWrapper(statsReceiver.counter(name))
}