2014-05-07 14:49:35 +02:00
|
|
|
package akka
|
|
|
|
|
|
|
|
|
|
import sbt._
|
|
|
|
|
|
|
|
|
|
object Dependencies {
|
|
|
|
|
|
2014-09-16 10:53:04 +02:00
|
|
|
import DependencyHelpers._
|
2014-11-30 15:53:41 +02:00
|
|
|
import DependencyHelpers.ScalaVersionDependentModuleID._
|
2014-09-16 10:53:04 +02:00
|
|
|
|
2014-05-07 14:49:35 +02:00
|
|
|
object Versions {
|
2015-01-15 22:26:20 +01:00
|
|
|
val crossScala = Seq("2.11.5", "2.10.4")
|
2014-11-30 15:53:41 +02:00
|
|
|
val scalaVersion = crossScala.head
|
2014-05-07 14:49:35 +02:00
|
|
|
val scalaStmVersion = sys.props.get("akka.build.scalaStmVersion").getOrElse("0.7")
|
|
|
|
|
val scalaTestVersion = sys.props.get("akka.build.scalaTestVersion").getOrElse("2.1.3")
|
|
|
|
|
val scalaCheckVersion = sys.props.get("akka.build.scalaCheckVersion").getOrElse("1.11.3")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object Compile {
|
|
|
|
|
import Versions._
|
|
|
|
|
|
|
|
|
|
// Compile
|
|
|
|
|
val camelCore = "org.apache.camel" % "camel-core" % "2.13.0" exclude("org.slf4j", "slf4j-api") // ApacheV2
|
|
|
|
|
|
2014-06-12 17:26:26 +09:00
|
|
|
// when updating config version, update links ActorSystem ScalaDoc to link to the updated version
|
2014-05-21 10:16:24 +02:00
|
|
|
val config = "com.typesafe" % "config" % "1.2.1" // ApacheV2
|
2014-05-07 14:49:35 +02:00
|
|
|
val netty = "io.netty" % "netty" % "3.8.0.Final" // ApacheV2
|
|
|
|
|
val protobuf = "com.google.protobuf" % "protobuf-java" % "2.5.0" // New BSD
|
|
|
|
|
val scalaStm = "org.scala-stm" %% "scala-stm" % scalaStmVersion // Modified BSD (Scala)
|
|
|
|
|
|
2014-12-12 11:49:32 -06:00
|
|
|
val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.7" // MIT
|
2014-09-11 14:32:54 +02:00
|
|
|
// mirrored in OSGi sample
|
2014-05-07 14:49:35 +02:00
|
|
|
val uncommonsMath = "org.uncommons.maths" % "uncommons-maths" % "1.2.2a" exclude("jfree", "jcommon") exclude("jfree", "jfreechart") // ApacheV2
|
|
|
|
|
val osgiCore = "org.osgi" % "org.osgi.core" % "4.3.1" // ApacheV2
|
|
|
|
|
val osgiCompendium= "org.osgi" % "org.osgi.compendium" % "4.3.1" // ApacheV2
|
|
|
|
|
val levelDB = "org.iq80.leveldb" % "leveldb" % "0.7" // ApacheV2
|
|
|
|
|
val levelDBNative = "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.7" // New BSD
|
2014-11-13 18:56:02 +02:00
|
|
|
val sigar = "org.fusesource" % "sigar" % "1.6.4" // ApacheV2
|
2014-05-07 14:49:35 +02:00
|
|
|
|
|
|
|
|
object Test {
|
|
|
|
|
val commonsMath = "org.apache.commons" % "commons-math" % "2.1" % "test" // ApacheV2
|
|
|
|
|
val commonsIo = "commons-io" % "commons-io" % "2.4" % "test" // ApacheV2
|
|
|
|
|
val commonsCodec = "commons-codec" % "commons-codec" % "1.7" % "test" // ApacheV2
|
|
|
|
|
val junit = "junit" % "junit" % "4.10" % "test" // Common Public License 1.0
|
|
|
|
|
val logback = "ch.qos.logback" % "logback-classic" % "1.0.13" % "test" // EPL 1.0 / LGPL 2.1
|
2014-07-04 09:45:35 +02:00
|
|
|
val mockito = "org.mockito" % "mockito-all" % "1.9.5" % "test" // MIT
|
2014-05-07 14:49:35 +02:00
|
|
|
// changing the scalatest dependency must be reflected in akka-docs/rst/dev/multi-jvm-testing.rst
|
|
|
|
|
val scalatest = "org.scalatest" %% "scalatest" % scalaTestVersion % "test" // ApacheV2
|
|
|
|
|
val scalacheck = "org.scalacheck" %% "scalacheck" % scalaCheckVersion % "test" // New BSD
|
|
|
|
|
val pojosr = "com.googlecode.pojosr" % "de.kalpatec.pojosr.framework" % "0.2.1" % "test" // ApacheV2
|
|
|
|
|
val tinybundles = "org.ops4j.pax.tinybundles" % "tinybundles" % "1.0.0" % "test" // ApacheV2
|
|
|
|
|
val log4j = "log4j" % "log4j" % "1.2.14" % "test" // ApacheV2
|
|
|
|
|
val junitIntf = "com.novocode" % "junit-interface" % "0.8" % "test" // MIT
|
2014-09-16 10:53:04 +02:00
|
|
|
val scalaXml = post210Dependency("org.scala-lang.modules" %% "scala-xml" % "1.0.1" % "test")
|
=act,tes Initial draft of internal MetricsKit
Note: This is NOT aimed to provide an micro-benchmarking solution.
The goal is to provide data for broad trend analysis. For techniques
that fight the inliner and other specialised techniques, refer to JMH.
+ custom console and graphite reporters
- had to be custom because it's not possible to add custom metric
types to the existing reporters
+ initial hdr.Histogram histogram() provider, see
http://latencyutils.github.io/LatencyUtils/
+ Not using timers provided by Metrics, instead use the above histogram
+ Added average Actor size measurement
+ Measuring the "blocking time" when an actor is created, before we fire
of the async part of this process; Measures in loop and will fluctuate
a lot. Times are in `us` -- System.nanoTime should provide good enough
resolution.
+ Measuring total actor creation time by using
`KnownOpsInTimespanTimer`, which given a known number of ops, in a
large amount of time, roughtly estimates time per one operation.
// Yes, we are aware of the possibility of GC pauses and other horrors
+ All classes are `private[akka]`, we should not encourage people to use
this yet
+ Counters use Java 8's `LongAdder`, which is metric's private;
The new trend in Java land will be copy paste-ing this class ;)
+ Metrics are logged to Graphite, so we can long-term analyse these
+ Reporters are configurable using typesafe-config
! I'm not very happy about how I work around Metrics not being too open
for adding additional custom metrics. Seems like a hack at places.
I will consider removing the Metrics dependency all together.
numbers
Example output:
```
-- KnownOpsInTimespanTimer-------------------------------------------
actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same
ops = 100000
time = 1.969 s
ops/s = 50782.22
avg = 19.69 μs
-- AveragingGauge---------------------------------------------------
actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor
avg = 439.67
```
2014-04-29 10:50:36 +02:00
|
|
|
|
|
|
|
|
// metrics, measurements, perf testing
|
|
|
|
|
val metrics = "com.codahale.metrics" % "metrics-core" % "3.0.1" % "test" // ApacheV2
|
|
|
|
|
val metricsJvm = "com.codahale.metrics" % "metrics-jvm" % "3.0.1" % "test" // ApacheV2
|
|
|
|
|
val latencyUtils = "org.latencyutils" % "LatencyUtils" % "1.0.3" % "test" // Free BSD
|
|
|
|
|
val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "1.1.4" % "test" // CC0
|
2014-05-19 17:29:35 +02:00
|
|
|
val metricsAll = Seq(metrics, metricsJvm, latencyUtils, hdrHistogram)
|
2014-12-12 11:49:32 -06:00
|
|
|
|
|
|
|
|
// sigar logging
|
|
|
|
|
val slf4jJul = "org.slf4j" % "jul-to-slf4j" % "1.7.7" % "test" // MIT
|
|
|
|
|
val slf4jLog4j = "org.slf4j" % "log4j-over-slf4j" % "1.7.7" % "test" // MIT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object Provided {
|
|
|
|
|
// TODO remove from "test" config
|
|
|
|
|
val sigarLoader = "io.kamon" % "sigar-loader" % "1.6.5-rev001" % "optional;provided;test" // ApacheV2
|
2014-05-07 14:49:35 +02:00
|
|
|
}
|
2014-12-12 11:49:32 -06:00
|
|
|
|
2014-05-07 14:49:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
import Compile._
|
|
|
|
|
|
|
|
|
|
val actor = Seq(config)
|
|
|
|
|
|
=act,tes Initial draft of internal MetricsKit
Note: This is NOT aimed to provide an micro-benchmarking solution.
The goal is to provide data for broad trend analysis. For techniques
that fight the inliner and other specialised techniques, refer to JMH.
+ custom console and graphite reporters
- had to be custom because it's not possible to add custom metric
types to the existing reporters
+ initial hdr.Histogram histogram() provider, see
http://latencyutils.github.io/LatencyUtils/
+ Not using timers provided by Metrics, instead use the above histogram
+ Added average Actor size measurement
+ Measuring the "blocking time" when an actor is created, before we fire
of the async part of this process; Measures in loop and will fluctuate
a lot. Times are in `us` -- System.nanoTime should provide good enough
resolution.
+ Measuring total actor creation time by using
`KnownOpsInTimespanTimer`, which given a known number of ops, in a
large amount of time, roughtly estimates time per one operation.
// Yes, we are aware of the possibility of GC pauses and other horrors
+ All classes are `private[akka]`, we should not encourage people to use
this yet
+ Counters use Java 8's `LongAdder`, which is metric's private;
The new trend in Java land will be copy paste-ing this class ;)
+ Metrics are logged to Graphite, so we can long-term analyse these
+ Reporters are configurable using typesafe-config
! I'm not very happy about how I work around Metrics not being too open
for adding additional custom metrics. Seems like a hack at places.
I will consider removing the Metrics dependency all together.
numbers
Example output:
```
-- KnownOpsInTimespanTimer-------------------------------------------
actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same
ops = 100000
time = 1.969 s
ops/s = 50782.22
avg = 19.69 μs
-- AveragingGauge---------------------------------------------------
actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor
avg = 439.67
```
2014-04-29 10:50:36 +02:00
|
|
|
val testkit = Seq(Test.junit, Test.scalatest) ++ Test.metricsAll
|
2014-05-07 14:49:35 +02:00
|
|
|
|
|
|
|
|
val actorTests = Seq(Test.junit, Test.scalatest, Test.commonsCodec, Test.commonsMath, Test.mockito, Test.scalacheck, protobuf, Test.junitIntf)
|
|
|
|
|
|
|
|
|
|
val remote = Seq(netty, protobuf, uncommonsMath, Test.junit, Test.scalatest)
|
|
|
|
|
|
2014-09-16 10:53:04 +02:00
|
|
|
val remoteTests = deps(Test.junit, Test.scalatest, Test.scalaXml)
|
2014-05-07 14:49:35 +02:00
|
|
|
|
|
|
|
|
val cluster = Seq(Test.junit, Test.scalatest)
|
|
|
|
|
|
2014-12-12 11:49:32 -06:00
|
|
|
val clusterMetrics = Seq(Provided.sigarLoader, Test.slf4jJul, Test.slf4jLog4j, Test.logback, Test.mockito)
|
|
|
|
|
|
2014-05-07 14:49:35 +02:00
|
|
|
val slf4j = Seq(slf4jApi, Test.logback)
|
|
|
|
|
|
|
|
|
|
val agent = Seq(scalaStm, Test.scalatest, Test.junit)
|
|
|
|
|
|
2014-09-16 10:53:04 +02:00
|
|
|
val persistence = deps(levelDB, levelDBNative, protobuf, Test.scalatest, Test.junit, Test.commonsIo, Test.scalaXml)
|
2014-05-07 14:49:35 +02:00
|
|
|
|
2014-07-08 18:30:15 +02:00
|
|
|
val persistenceTck = Seq(Test.scalatest.copy(configurations = Some("compile")), Test.junit.copy(configurations = Some("compile")))
|
|
|
|
|
|
2014-05-07 14:49:35 +02:00
|
|
|
val kernel = Seq(Test.scalatest, Test.junit)
|
|
|
|
|
|
|
|
|
|
val camel = Seq(camelCore, Test.scalatest, Test.junit, Test.mockito, Test.logback, Test.commonsIo, Test.junitIntf)
|
|
|
|
|
|
|
|
|
|
val osgi = Seq(osgiCore, osgiCompendium, Test.logback, Test.commonsIo, Test.pojosr, Test.tinybundles, Test.scalatest, Test.junit)
|
|
|
|
|
|
|
|
|
|
val docs = Seq(Test.scalatest, Test.junit, Test.junitIntf)
|
|
|
|
|
|
|
|
|
|
val contrib = Seq(Test.junitIntf, Test.commonsIo)
|
|
|
|
|
}
|
2014-09-16 10:53:04 +02:00
|
|
|
|
|
|
|
|
object DependencyHelpers {
|
|
|
|
|
|
|
|
|
|
import sbt.Keys._
|
|
|
|
|
|
|
|
|
|
case class ScalaVersionDependentModuleID(val modules: String => Seq[ModuleID]) {
|
|
|
|
|
def %(config: String): ScalaVersionDependentModuleID =
|
|
|
|
|
ScalaVersionDependentModuleID(version => modules(version).map(_ % config))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object ScalaVersionDependentModuleID {
|
|
|
|
|
implicit def liftConstantModule(mod: ModuleID): ScalaVersionDependentModuleID =
|
|
|
|
|
ScalaVersionDependentModuleID(_ => Seq(mod))
|
|
|
|
|
|
|
|
|
|
def fromPF(f: PartialFunction[String, ModuleID]): ScalaVersionDependentModuleID =
|
|
|
|
|
ScalaVersionDependentModuleID(version => if (f.isDefinedAt(version)) Seq(f(version)) else Nil)
|
|
|
|
|
|
|
|
|
|
def post210Dependency(moduleId: ModuleID): ScalaVersionDependentModuleID = ScalaVersionDependentModuleID.fromPF {
|
|
|
|
|
case version if !version.startsWith("2.10") => moduleId
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Use this as a dependency setting if the dependencies contain both static and Scala-version
|
|
|
|
|
* dependent entries.
|
|
|
|
|
*/
|
|
|
|
|
def deps(modules: ScalaVersionDependentModuleID*) =
|
|
|
|
|
libraryDependencies <++= scalaVersion(version => modules.flatMap(m => m.modules(version)))
|
|
|
|
|
}
|