aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon
diff options
context:
space:
mode:
authorDiego Parra <diegolparra@gmail.com>2013-10-03 13:23:31 -0300
committerDiego Parra <diegolparra@gmail.com>2013-10-03 13:24:39 -0300
commite71903ae4fbcc08a0d674fb652792b38b0749cea (patch)
tree035c7b9e8fec0ee2f5008e832a810675da3cb0d3 /kamon-core/src/main/scala/kamon
parent0b62687fd294de343ae90824f4d570e4273586c1 (diff)
downloadKamon-e71903ae4fbcc08a0d674fb652792b38b0749cea.tar.gz
Kamon-e71903ae4fbcc08a0d674fb652792b38b0749cea.tar.bz2
Kamon-e71903ae4fbcc08a0d674fb652792b38b0749cea.zip
cleanup cleanup cleanup
Diffstat (limited to 'kamon-core/src/main/scala/kamon')
-rw-r--r--kamon-core/src/main/scala/kamon/TransactionPublisher.scala15
-rw-r--r--kamon-core/src/main/scala/kamon/executor/eventbus.scala103
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/SampleInstrumentation.scala49
-rw-r--r--kamon-core/src/main/scala/kamon/metric/MetricsUtils.scala51
-rw-r--r--kamon-core/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala1
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)
}
}