diff options
author | Diego Parra <diegolparra@gmail.com> | 2013-10-03 13:23:31 -0300 |
---|---|---|
committer | Diego Parra <diegolparra@gmail.com> | 2013-10-03 13:24:39 -0300 |
commit | 562bebe1d0ce74217f4c355e3ab49c9ae03cdb61 (patch) | |
tree | 26c72c6f06d38a83a6cf1b661c2e82a6c9936172 /kamon-core/src/main/scala/kamon | |
parent | 4045ba1274fe6ba51ab071de6e2a5e1b31cef668 (diff) | |
download | Kamon-562bebe1d0ce74217f4c355e3ab49c9ae03cdb61.tar.gz Kamon-562bebe1d0ce74217f4c355e3ab49c9ae03cdb61.tar.bz2 Kamon-562bebe1d0ce74217f4c355e3ab49c9ae03cdb61.zip |
cleanup cleanup cleanup
Diffstat (limited to 'kamon-core/src/main/scala/kamon')
5 files changed, 0 insertions, 219 deletions
diff --git a/kamon-core/src/main/scala/kamon/TransactionPublisher.scala b/kamon-core/src/main/scala/kamon/TransactionPublisher.scala deleted file mode 100644 index 0626b91d..00000000 --- a/kamon-core/src/main/scala/kamon/TransactionPublisher.scala +++ /dev/null @@ -1,15 +0,0 @@ -package kamon - -import akka.actor.Actor -import java.util.UUID - -class TransactionPublisher extends Actor { - - def receive = { - case FullTransaction(id, entries) => println(s"I got a full tran: $id - $entries") - } - -} - - -case class FullTransaction(id: UUID, entries: List[TraceEntry]) diff --git a/kamon-core/src/main/scala/kamon/executor/eventbus.scala b/kamon-core/src/main/scala/kamon/executor/eventbus.scala deleted file mode 100644 index d51305a8..00000000 --- a/kamon-core/src/main/scala/kamon/executor/eventbus.scala +++ /dev/null @@ -1,103 +0,0 @@ -package kamon.executor - -import akka.event.ActorEventBus -import akka.event.LookupClassification -import akka.actor._ -import java.util.concurrent.TimeUnit - -import kamon.{Tracer, CodeBlockExecutionTime, Kamon, TraceContext} -import akka.util.Timeout -import scala.util.{Random, Success, Failure} -import scala.concurrent.Future - -trait Message - -case class PostMessage(text:String) extends Message - -case class MessageEvent(val channel:String, val message:Message) - -class AppActorEventBus extends ActorEventBus with LookupClassification{ - type Event = MessageEvent - type Classifier=String - protected def mapSize(): Int={ - 10 - } - - protected def classify(event: Event): Classifier={ - event.channel - } - - protected def publish(event: Event, subscriber: Subscriber): Unit={ - subscriber ! event - } -} -case class Ping() -case class Pong() - -class PingActor extends Actor with ActorLogging { - - val pong = context.actorOf(Props[PongActor], "Pong") - val random = new Random() - def receive = { - case Pong() => { - //Thread.sleep(random.nextInt(2000)) - //log.info("Message from Ping") - pong ! Ping() - } - } -} - -class PongActor extends Actor with ActorLogging { - def receive = { - case Ping() => { - sender ! Pong() - } - } -} - - -object TryAkka extends App{ - val system = ActorSystem("MySystem") - val appActorEventBus=new AppActorEventBus - val NEW_POST_CHANNEL="/posts/new" - val subscriber = system.actorOf(Props(new Actor { - def receive = { - case d: MessageEvent => println(d) - } - })) - - Tracer.start - for(i <- 1 to 4) { - val ping = system.actorOf(Props[PingActor], "Ping" + i) - ping ! Pong() - } - - - def threadPrintln(body: String) = println(s"[${Thread.currentThread().getName}] - [${Tracer.context}] : $body") - - /* - val newRelicReporter = new NewRelicReporter(registry) - newRelicReporter.start(1, TimeUnit.SECONDS) - -*/ - import akka.pattern.ask - implicit val timeout = Timeout(10, TimeUnit.SECONDS) - implicit def execContext = system.dispatcher - - - - //Tracer.start - - Tracer.context.get.append(CodeBlockExecutionTime("some-block", System.nanoTime(), System.nanoTime())) - threadPrintln("Before doing it") - val f = Future { threadPrintln("This is happening inside the future body") } - - - - - //Thread.sleep(3000) - //system.shutdown() - -/* appActorEventBus.subscribe(subscriber, NEW_POST_CHANNEL) - appActorEventBus.publish(MessageEvent(NEW_POST_CHANNEL,PostMessage(text="hello world")))*/ -}
\ No newline at end of file diff --git a/kamon-core/src/main/scala/kamon/instrumentation/SampleInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/SampleInstrumentation.scala deleted file mode 100644 index 74261403..00000000 --- a/kamon-core/src/main/scala/kamon/instrumentation/SampleInstrumentation.scala +++ /dev/null @@ -1,49 +0,0 @@ -package kamon.instrumentation - -import com.codahale.metrics.{ExponentiallyDecayingReservoir, Histogram} -import org.aspectj.lang.annotation.{After, Pointcut, DeclareMixin, Aspect} - -class ActorCage(val name: String, val size: Int) { - - def doIt: Unit = println("name") -} - -trait CageMonitoring { - def histogram: Histogram - def count(value: Int): Unit -} - -class CageMonitoringImp extends CageMonitoring{ - final val histogram = new Histogram(new ExponentiallyDecayingReservoir()) - - def count(value: Int) = histogram.update(value) - -} - - -@Aspect -class InceptionAspect { - - @DeclareMixin("kamon.instrumentation.ActorCage") - def mixin: CageMonitoring = new CageMonitoringImp - - - @Pointcut("execution(* kamon.instrumentation.ActorCage.doIt()) && target(actorCage)") - def theActorCageDidIt(actorCage: CageMonitoring) = {} - - @After("theActorCageDidIt(actorCage)") - def afterDoingIt(actorCage: CageMonitoring) = { - actorCage.count(1) - actorCage.histogram.getSnapshot.dump(System.out) - } - - - -} - - -object Runner extends App { - val cage = new ActorCage("ivan", 10) - - cage.doIt -} diff --git a/kamon-core/src/main/scala/kamon/metric/MetricsUtils.scala b/kamon-core/src/main/scala/kamon/metric/MetricsUtils.scala deleted file mode 100644 index 5b4ceaf4..00000000 --- a/kamon-core/src/main/scala/kamon/metric/MetricsUtils.scala +++ /dev/null @@ -1,51 +0,0 @@ -package kamon.metric - -import com.codahale.metrics._ - -object MetricsUtils { - - def markMeter[T](meter:Meter)(f: => T): T = { - meter.mark() - f - } -// -// def incrementCounter(key: String) { -// counters.getOrElseUpdate(key, (metricsGroup.counter(s"${key}-counter"))).count -// } -// -// def markMeter(key: String) { -// meters.getOrElseUpdate(key, metricsGroup.meter(s"${key}-meter", "actor", "actor-message-counter", TimeUnit.SECONDS)).mark() -// } -// -// def trace[T](key: String)(f: => T): T = { -// val timer = timers.getOrElseUpdate(key, (metricsGroup.timer(s"${key}-timer")) ) -// timer.time(f) -// } - -// def markAndCountMeter[T](key: String)(f: => T): T = { -// markMeter(key) -// f -// } -// -// def traceAndCount[T](key: String)(f: => T): T = { -// incrementCounter(key) -// trace(key) { -// f -// } - //} - -// implicit def runnable(f: () => Unit): Runnable = -// new Runnable() { def run() = f() } -// -// -// import java.util.concurrent.Callable -// -// implicit def callable[T](f: () => T): Callable[T] = -// new Callable[T]() { def call() = f() } - -// private val actorCounter:Counter = new Counter -// private val actorTimer:Timer = new Timer -// -// metricsRegistry.register(s"counter-for-${actorName}", actorCounter) -// metricsRegistry.register(s"timer-for-${actorName}", actorTimer) -}
\ No newline at end of file diff --git a/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala b/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala index 72bcb4e2..4bc49496 100644 --- a/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala +++ b/kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala @@ -13,7 +13,6 @@ class NewRelicErrorLogger extends Actor { } def notifyError(error: Error): Unit = { - println(error.message) noticeError(error.cause) } } |