Permalink
Browse files

wip

  • Loading branch information...
1 parent e02d137 commit 56039ef037d42cb817d0bc6d5a5891bc87e633c3 @dpsoft dpsoft committed Dec 4, 2016
Showing with 775 additions and 152 deletions.
  1. +57 −0 .gitignore
  2. +12 −0 .travis.yml
  3. +35 −0 CONTRIBUTING.md
  4. +15 −0 LICENSE
  5. +60 −0 README.md
  6. +60 −0 build.sbt
  7. +2 −2 kamon-autoweave/src/main/scala/kamon/autoweave/loader/AgentLoader.scala
  8. +3 −3 kamon-autoweave/src/main/scala/kamon/autoweave/loader/AttachmentProviders.scala
  9. +2 −2 kamon-core/src/main/scala/kamon/Kamon.scala
  10. +1 −1 kamon-core/src/main/scala/kamon/ModuleLoader.scala
  11. +2 −2 kamon-core/src/main/scala/kamon/metric/EntityRecorder.scala
  12. +1 −1 kamon-core/src/main/scala/kamon/metric/EntitySnapshot.scala
  13. +6 −4 kamon-core/src/main/scala/kamon/metric/MetricScaleDecorator.scala
  14. +17 −9 kamon-core/src/main/scala/kamon/metric/MetricsModule.scala
  15. +2 −1 kamon-core/src/main/scala/kamon/metric/MetricsSettings.scala
  16. +1 −1 kamon-core/src/main/scala/kamon/metric/SubscriptionsDispatcher.scala
  17. +1 −1 kamon-core/src/main/scala/kamon/metric/TickMetricSnapshotBuffer.scala
  18. +1 −1 kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala
  19. +1 −1 kamon-core/src/main/scala/kamon/metric/instrument/Gauge.scala
  20. +7 −5 kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala
  21. +16 −8 kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala
  22. +2 −2 kamon-core/src/main/scala/kamon/metric/instrument/MinMaxCounter.scala
  23. +1 −1 kamon-core/src/main/scala/kamon/metric/instrument/RefreshScheduler.scala
  24. +3 −3 kamon-core/src/main/scala/kamon/trace/Incubator.scala
  25. +22 −13 kamon-core/src/main/scala/kamon/trace/MetricsOnlyContext.scala
  26. +1 −1 kamon-core/src/main/scala/kamon/trace/Sampler.scala
  27. +2 −2 kamon-core/src/main/scala/kamon/trace/TraceContext.scala
  28. +1 −1 kamon-core/src/main/scala/kamon/trace/TraceSubscriptions.scala
  29. +1 −1 kamon-core/src/main/scala/kamon/trace/TracerModule.scala
  30. +9 −5 kamon-core/src/main/scala/kamon/trace/TracingContext.scala
  31. +2 −2 kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala
  32. +1 −1 kamon-core/src/main/scala/kamon/util/ConfigTools.scala
  33. +1 −1 kamon-core/src/main/scala/kamon/util/FastDispatch.scala
  34. +1 −1 kamon-core/src/main/scala/kamon/util/LazyActorRef.scala
  35. +1 −1 kamon-core/src/main/scala/kamon/util/MapMerge.scala
  36. +2 −2 kamon-core/src/main/scala/kamon/util/NeedToScale.scala
  37. +3 −3 kamon-core/src/main/scala/kamon/util/executors/ExecutorMetricRecorder.scala
  38. +5 −5 kamon-core/src/main/scala/kamon/util/executors/ExecutorServiceMetrics.scala
  39. +1 −1 kamon-core/src/main/scala/kamon/util/http/HttpServerMetrics.scala
  40. +2 −2 kamon-core/src/main/scala/kamon/util/logger/LazyLogger.scala
  41. +5 −3 kamon-core/src/test/scala/kamon/metric/MetricScaleDecoratorSpec.scala
  42. +4 −3 kamon-core/src/test/scala/kamon/metric/SubscriptionsProtocolSpec.scala
  43. +6 −3 kamon-core/src/test/scala/kamon/metric/TickMetricSnapshotBufferSpec.scala
  44. +16 −12 kamon-core/src/test/scala/kamon/metric/TraceMetricsSpec.scala
  45. +1 −1 kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala
  46. +11 −11 kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala
  47. +11 −6 kamon-core/src/test/scala/kamon/metric/instrument/MinMaxCounterSpec.scala
  48. +1 −1 kamon-core/src/test/scala/kamon/metric/instrument/UnitOfMeasurementSpec.scala
  49. +3 −3 kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala
  50. +6 −6 kamon-core/src/test/scala/kamon/trace/SimpleTraceSpec.scala
  51. +2 −2 kamon-core/src/test/scala/kamon/trace/TraceContextManipulationSpec.scala
  52. +1 −1 kamon-core/src/test/scala/kamon/trace/logging/MdcKeysSupportSpec.scala
  53. +1 −1 kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala
  54. +8 −5 kamon-core/src/test/scala/kamon/util/NeedToScaleSpec.scala
  55. +1 −1 kamon-core/src/test/scala/kamon/util/RegexPathFilterSpec.scala
  56. +1 −1 kamon-core/src/test/scala/kamon/util/executors/ExecutorServiceMetricsSpec.scala
  57. +1 −1 kamon-testkit/src/main/scala/testkit/AkkaExtensionSwap.scala
  58. +1 −1 kamon-testkit/src/main/scala/testkit/TestProbeInstrumentation.scala
  59. +46 −0 project/Dependencies.scala
  60. +50 −0 project/Publish.scala
  61. +80 −0 project/Release.scala
  62. +70 −0 project/Settings.scala
  63. +28 −0 project/VersionWithSHA.scala
  64. +1 −0 project/build.properties
  65. +16 −0 project/plugins.sbt
  66. +40 −0 travis-test.sh
  67. +1 −0 version.sbt
View
@@ -0,0 +1,57 @@
+*.class
+*.log
+.history
+*.sc
+.pygments-cache
+.DS_Store
+
+# sbt specific
+dist/*
+target/
+lib_managed/
+src_managed/
+project/boot/
+project/plugins/project/
+.ensime
+.ensime_cache
+
+# Scala-IDE specific
+.scala_dependencies
+.idea
+.idea_modules
+
+# Intellij
+.idea/
+*.iml
+*.iws
+
+# Eclipse
+.project
+.settings
+.classpath
+.cache
+.cache-main
+.cache-tests
+bin/
+
+_site
+
+# Ignore Play! working directory #
+db
+eclipse
+lib
+log
+logs
+modules
+precompiled
+project/project
+project/target
+target
+tmp
+test-result
+server.pid
+*.iml
+*.eml
+
+# Default sigar library provision location.
+native/
View
@@ -0,0 +1,12 @@
+language: scala
+script:
+ - ./travis-test.sh
+scala:
+ - 2.11.8
+jdk:
+ - oraclejdk8
+before_script:
+ - mkdir $TRAVIS_BUILD_DIR/tmp
+ - export SBT_OPTS="-Djava.io.tmpdir=$TRAVIS_BUILD_DIR/tmp"
+sudo: false
+
View
@@ -0,0 +1,35 @@
+Contributing to Kamon
+=====================
+
+Thanks for your intention on collaborating to the Kamon Project! It doesn't matter if you want to provide a small change
+to our docs, are lost in configuration or want contribute a brand new feature, we value all of your contributions and
+the time you take to use our tool and prepare a contribution, we only ask you to follow this guidance depending on your
+situation:
+
+If you are experiencing a bug
+-----------------------------
+
+If you see weird exceptions in your log or something definitely is working improperly please [open an issue] and include
+the Kamon, Akka and Spray/Play! versions that you are using along with as many useful information you can find related
+to the issue. If you can provide a gist or a short way to reproduce the issue we will be more than happy!
+
+If you don't know what is wrong
+-------------------------------
+
+If you don't see any metrics at all or features are not working maybe you have a setup or configuration problem, to
+address this kind of problems please send us a emails to our [mailing list] and we will reply as soon as we can! Again,
+please include the relevant version and current setup information to speed up the process. If you are in doubt of
+whether you have a bug or a configuration problem, email us and we will take care of openning a issue if necessary.
+
+If you want to make a code contribution to the project
+------------------------------------------------------
+
+Awesome! First, please note that we try to follow the [commit message conventions] used by the Spray guys and we need
+you to electronically fill our [CLA] before accepting your contribution. Also, if your PR contains various commits,
+please squash them into a single commit. Let the PR rain begin!
+
+
+[open an issue]: https://github.com/kamon-io/Kamon/issues/new
+[mailing list]: https://groups.google.com/forum/#!forum/kamon-user
+[commit message conventions]: http://spray.io/project-info/contributing/
+[CLA]: https://docs.google.com/forms/d/1G_IDrBTFzOMwHvhxfKRBwNtpRelSa_MZ6jecH8lpTlc/viewform
View
@@ -0,0 +1,15 @@
+This software is licensed under the Apache 2 license, quoted below.
+
+Copyright © 2013-2014 the kamon project <http://kamon.io>
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+ [http://www.apache.org/licenses/LICENSE-2.0]
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
View
@@ -0,0 +1,60 @@
+Kamon [![Build Status](https://travis-ci.org/kamon-io/Kamon.svg?branch=master)](https://travis-ci.org/kamon-io/Kamon)
+=========
+
+Kamon is a set of tools for monitoring applications running on the JVM.
+
+[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kamon-io/Kamon?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.kamon/kamon-core_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.kamon/kamon-core_2.11)
+
+
+Modules
+============
+
+[Play Framework] ![Build Status](https://travis-ci.org/kamon-io/kamon-play.svg?branch=master)
+[Spray] ![Build Status](https://travis-ci.org/kamon-io/kamon-spray.svg?branch=master)
+[Akka] ![Build Status](https://travis-ci.org/kamon-io/kamon-akka.svg?branch=master)
+[Akka Remote] ![Build Status](https://travis-ci.org/kamon-io/kamon-akka-remote.svg?branch=master)
+[Akka Http] ![Build Status](https://travis-ci.org/kamon-io/kamon-akka-http.svg?branch=master)
+[Scala] ![Build Status](https://travis-ci.org/kamon-io/kamon-scala.svg?branch=master)
+[Annotation] ![Build Status](https://travis-ci.org/kamon-io/kamon-annotation.svg?branch=master)
+[System Metrics] ![Build Status](https://travis-ci.org/kamon-io/kamon-system-metrics.svg?branch=master)
+[JDBC] ![Build Status](https://travis-ci.org/kamon-io/kamon-jdbc.svg?branch=master)
+[Elasticsearch] ![Build Status](https://travis-ci.org/kamon-io/kamon-elasticsearch.svg?branch=master)
+
+Backends
+========
+
+[Log Reporter] ![Build Status](https://travis-ci.org/kamon-io/kamon-log-reporter.svg?branch=master)
+[StatsD] ![Build Status](https://travis-ci.org/kamon-io/kamon-statsd.svg?branch=master)
+[Datadog] ![Build Status](https://travis-ci.org/kamon-io/kamon-datadog.svg?branch=master)
+[SPM] ![Build Status](https://travis-ci.org/kamon-io/kamon-spm.svg?branch=master)
+[InfluxDB] ![Build Status](https://travis-ci.org/kamon-io/kamon-influxdb.svg?branch=master)
+[New Relic] ![Build Status](https://travis-ci.org/kamon-io/kamon-newrelic.svg?branch=master)
+[FluentD] ![Build Status](https://travis-ci.org/kamon-io/kamon-fluentd.svg?branch=master)
+[JMX] ![Build Status](https://travis-ci.org/kamon-io/kamon-jmx.svg?branch=master)
+[Riemann] ![Build Status](https://travis-ci.org/kamon-io/kamon-riemann.svg?branch=master)
+[Krhonus] ![Build Status](https://travis-ci.org/kamon-io/kamon-khronus.svg?branch=master)
+
+
+[Play Framework]: https://github.com/kamon-io/kamon-play
+[Spray]: https://github.com/kamon-io/kamon-spray
+[Akka]:https://github.com/kamon-io/kamon-akka
+[Akka Remote]: https://github.com/kamon-io/kamon-akka-remote
+[Akka Http]: https://github.com/kamon-io/kamon-akka-http
+[Scala]: https://github.com/kamon-io/kamon-scala
+[Annotation]: https://github.com/kamon-io/kamon-annotation
+[System Metrics]: https://github.com/kamon-io/kamon-system-metrics
+[JDBC]: https://github.com/kamon-io/kamon-jdbc
+[Elasticsearch]: https://github.com/kamon-io/kamon-elasticsearch
+
+[Log Reporter]: https://github.com/kamon-io/kamon-log-reporter
+[SPM]: https://github.com/kamon-io/kamon-spm
+[Datadog]: https://github.com/kamon-io/kamon-datadog
+[FluentD]: https://github.com/kamon-io/kamon-fluentd
+[JMX]: https://github.com/kamon-io/kamon-jmx
+[StatsD]: https://github.com/kamon-io/kamon-statsd
+[Riemann]: https://github.com/kamon-io/kamon-riemann
+[Krhonus]: https://github.com/kamon-io/kamon-khronus
+[New Relic]: https://github.com/kamon-io/kamon-newrelic
+[InfluxDB]: https://github.com/kamon-io/kamon-influxdb
+
View
@@ -0,0 +1,60 @@
+/* =========================================================================================
+ * Copyright © 2013-2016 the kamon project <http://kamon.io/>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ * =========================================================================================
+ */
+
+
+import Settings._
+import Dependencies._
+
+lazy val kamon = (project in file("."))
+ .settings(moduleName := "root")
+ .settings(basicSettings: _*)
+ .settings(formatSettings: _*)
+ .settings(noPublishing: _*)
+ .aggregate(core, autoweave, testkit)
+
+
+lazy val core = (project in file("kamon-core"))
+ .settings(basicSettings: _*)
+ .settings(formatSettings: _*)
+ .settings(
+ libraryDependencies ++=
+ compileScope(akkaActor, hdrHistogram, slf4jApi) ++
+ providedScope(aspectJ) ++
+ optionalScope(logback) ++
+ testScope(scalatest, akkaTestKit, akkaSlf4j, logback))
+
+
+lazy val autoweave = (project in file("kamon-autoweave"))
+ .dependsOn(core)
+ .settings(basicSettings: _*)
+ .settings(formatSettings: _*)
+ .settings(
+ libraryDependencies ++=
+ compileScope(aspectJ) ++
+ testScope(scalatest, slf4jApi))
+
+
+lazy val testkit = (project in file("kamon-testkit"))
+ .dependsOn(core)
+ .settings(basicSettings: _*)
+ .settings(formatSettings: _*)
+ .settings(
+ libraryDependencies ++=
+ compileScope(akkaActor, akkaTestKit) ++
+ providedScope(aspectJ) ++
+ testScope(slf4jApi, slf4jnop))
+
+
+lazy val noPublishing = Seq(publish := (), publishLocal := (), publishArtifact := false)
@@ -15,10 +15,10 @@
package kamon.autoweave.loader
-import java.io.{ File, FileOutputStream, InputStream }
+import java.io.{File, FileOutputStream, InputStream}
import java.lang.management.ManagementFactory
import java.util.jar.Attributes.Name
-import java.util.jar.{ JarEntry, JarOutputStream, Manifest }
+import java.util.jar.{JarEntry, JarOutputStream, Manifest}
import scala.util.control.NoStackTrace
@@ -16,11 +16,11 @@
package kamon.autoweave.loader
import java.io.File
-import java.net.{ URL, URLClassLoader }
-import java.security.{ AccessController, PrivilegedAction }
+import java.net.{URL, URLClassLoader}
+import java.security.{AccessController, PrivilegedAction}
import scala.util.control.NonFatal
-import scala.util.{ Failure, Success, Try }
+import scala.util.{Failure, Success, Try}
object AttachmentProviders {
@@ -16,13 +16,13 @@ package kamon
import _root_.akka.actor
import _root_.akka.actor._
-import com.typesafe.config.{ Config, ConfigFactory, ConfigParseOptions, ConfigResolveOptions }
+import com.typesafe.config.{Config, ConfigFactory, ConfigParseOptions, ConfigResolveOptions}
import kamon.metric._
import kamon.trace.TracerModuleImpl
import kamon.util.logger.LazyLogger
import _root_.scala.util.control.NonFatal
-import _root_.scala.util.{ Failure, Success, Try }
+import _root_.scala.util.{Failure, Success, Try}
object Kamon {
@@ -20,7 +20,7 @@ import _root_.akka.actor
import _root_.akka.actor._
import kamon.util.logger.LazyLogger
import org.aspectj.lang.ProceedingJoinPoint
-import org.aspectj.lang.annotation.{ Around, Aspect, Pointcut }
+import org.aspectj.lang.annotation.{Around, Aspect, Pointcut}
private[kamon] object ModuleLoader extends ExtensionId[ModuleLoaderExtension] with ExtensionIdProvider {
def lookup(): ExtensionId[_ <: actor.Extension] = ModuleLoader
@@ -59,7 +59,7 @@ private[kamon] sealed trait SingleInstrumentEntityRecorder extends EntityRecorde
def instrument: Instrument
def collect(collectionContext: CollectionContext): EntitySnapshot =
- new DefaultEntitySnapshot(Map(key -> instrument.collect(collectionContext)))
+ new DefaultEntitySnapshot(Map(key instrument.collect(collectionContext)))
def cleanup: Unit = instrument.cleanup
}
@@ -225,7 +225,7 @@ abstract class GenericEntityRecorder(instrumentFactory: InstrumentFactory) exten
def collect(collectionContext: CollectionContext): EntitySnapshot = {
val snapshots = Map.newBuilder[MetricKey, InstrumentSnapshot]
_instruments.foreach {
- case (key, instrument) snapshots += key -> instrument.collect(collectionContext)
+ case (key, instrument) snapshots += key instrument.collect(collectionContext)
}
new DefaultEntitySnapshot(snapshots.result())
@@ -16,7 +16,7 @@
package kamon.metric
-import kamon.metric.instrument.{ Counter, Histogram, CollectionContext, InstrumentSnapshot }
+import kamon.metric.instrument.{Counter, Histogram, CollectionContext, InstrumentSnapshot}
import kamon.util.MapMerge
import scala.reflect.ClassTag
@@ -16,7 +16,7 @@
package kamon.metric
-import akka.actor.{ Actor, ActorRef, Props }
+import akka.actor.{Actor, ActorRef, Props}
import kamon.metric.SubscriptionsDispatcher.TickMetricSnapshot
import kamon.metric.instrument._
@@ -28,8 +28,10 @@ import kamon.metric.instrument._
* @param receiver Receiver of scaled metrics snapshot, usually a backend sender
*/
class MetricScaleDecorator(timeUnits: Option[Time], memoryUnits: Option[Memory], receiver: ActorRef) extends Actor {
- require(timeUnits.isDefined || memoryUnits.isDefined,
- "Use MetricScaleDecorator only when any of units is defined")
+ require(
+ timeUnits.isDefined || memoryUnits.isDefined,
+ "Use MetricScaleDecorator only when any of units is defined"
+ )
override def receive: Receive = {
case tick: TickMetricSnapshot
@@ -41,7 +43,7 @@ class MetricScaleDecorator(timeUnits: Option[Time], memoryUnits: Option[Memory],
case (memory: Memory, _, Some(to)) metricSnapshot.scale(memory, to)
case _ metricSnapshot
}
- metricKey -> scaledSnapshot
+ metricKey scaledSnapshot
})
})
receiver forward scaled
Oops, something went wrong.

0 comments on commit 56039ef

Please sign in to comment.