Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Running Benchmarks on GCP (#15)
Browse files Browse the repository at this point in the history
* Adds sbt-assembly configuration - Assembling metrifier.

* Adds the instructions to upload jars to GCS

* Final instructions to run benchmarks on GCP

* Adds GCP benchmark results

* Tweaks docs. Adds a Table of contents
  • Loading branch information
juanpedromoreno committed Nov 2, 2017
1 parent f7e99fd commit e8f825a
Show file tree
Hide file tree
Showing 16 changed files with 2,584 additions and 1,192 deletions.
1,113 changes: 0 additions & 1,113 deletions BENCHMARK_RESULTS.md

This file was deleted.

377 changes: 316 additions & 61 deletions README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
lazy val shared = project
.in(file("shared"))
.settings(moduleName := "shared")
.settings(name := n(moduleName.value))

lazy val http = project
.in(file("http"))
.dependsOn(shared)
.aggregate(shared)
.settings(moduleName := "http")
.settings(name := n(moduleName.value))
.settings(libraryDependencies ++= httpDependencies)

lazy val `frees-rpc` = project
.in(file("frees-rpc"))
.dependsOn(shared)
.aggregate(shared)
.settings(moduleName := "frees-rpc")
.settings(name := n(moduleName.value))
.settings(libraryDependencies ++= rpcDependencies)
.settings(scalaMetaSettings: _*)

Expand All @@ -22,12 +25,14 @@ lazy val demo = project
.dependsOn(http, `frees-rpc`)
.aggregate(http, `frees-rpc`)
.settings(moduleName := "demo")
.settings(name := n(moduleName.value))
.settings(scalaMetaSettings: _*)

lazy val bench = project
.in(file("bench"))
.dependsOn(http, `frees-rpc`)
.aggregate(http, `frees-rpc`)
.settings(moduleName := "bench")
.settings(name := n(moduleName.value))
.settings(scalaMetaSettings: _*)
.enablePlugins(JmhPlugin)
Binary file removed chart-bar.png
Binary file not shown.
Binary file removed chart-radar.png
Binary file not shown.
Binary file added charts/chart-bar-gcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added charts/chart-bar-local.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added charts/chart-radar-gcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added charts/chart-radar-local.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions deploy/tmpl-compute.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ resources:
- name: http-server-vm
type: tmpl-vm.jinja
properties:
machineType: n1-standard-1
machineType: n1-standard-2
zone: us-central1-f
- name: rpc-server-vm
type: tmpl-vm.jinja
properties:
machineType: n1-standard-1
machineType: n1-standard-2
zone: us-central1-f
- name: http-jmh-vm
type: tmpl-vm.jinja
properties:
machineType: g1-small
machineType: n1-standard-1
zone: us-central1-f
- name: rpc-jmh-vm
type: tmpl-vm.jinja
properties:
machineType: g1-small
machineType: n1-standard-1
zone: us-central1-f
- name: {{ FIREWALL }}
type: tmpl-firewall.jinja
8 changes: 6 additions & 2 deletions deploy/tmpl-vm.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ resources:
sudo apt-get install -y software-properties-common python-software-properties
sudo apt-get update
sudo apt install -y -t jessie-backports openjdk-8-jre-headless ca-certificates-java
sudo apt-get install -y openjdk-8-jre
sudo apt-get install -y openjdk-8-jdk
sudo apt-get -y install apt-transport-https
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install -y sbt=1.0.2
sudo apt-get install -y sbt=1.0.2
sudo mkdir -p /metrifier/bench_results
sudo gsutil cp -R gs://metrifier /
sudo git clone https://github.com/47deg/metrifier.git /metrifier/repo && cd /metrifier/repo
sudo chmod -R 777 /metrifier/
38 changes: 28 additions & 10 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import sbt.Keys._
import sbt._
import sbtassembly.AssemblyPlugin
import sbtassembly.AssemblyPlugin.autoImport._

object ProjectPlugin extends AutoPlugin {

override def trigger: PluginTrigger = allRequirements

override def requires: Plugins = AssemblyPlugin

object autoImport {

lazy val V = new {
Expand All @@ -16,13 +20,12 @@ object ProjectPlugin extends AutoPlugin {
lazy val config = "1.3.1"
}

lazy val scalaMetaSettings: Seq[Def.Setting[_]] =
Seq(
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M10" cross CrossVersion.full),
libraryDependencies += "org.scalameta" %% "scalameta" % "1.8.0",
scalacOptions += "-Xplugin-require:macroparadise",
scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise")) // macroparadise plugin doesn't work in repl yet.
)
lazy val scalaMetaSettings: Seq[Def.Setting[_]] = Seq(
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M10" cross CrossVersion.full),
libraryDependencies += "org.scalameta" %% "scalameta" % "1.8.0",
scalacOptions += "-Xplugin-require:macroparadise",
scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise")) // macroparadise plugin doesn't work in repl yet.
)

lazy val httpDependencies: Seq[ModuleID] = Seq(
"org.http4s" %% "http4s-dsl" % V.http4sV,
Expand All @@ -36,9 +39,11 @@ object ProjectPlugin extends AutoPlugin {
)

lazy val rpcDependencies: Seq[ModuleID] = Seq(
"io.frees" %% "frees-rpc" % V.freesRPC,
"io.frees" %% "frees-async-cats-effect" % V.frees
"io.frees" %% "frees-rpc" % V.freesRPC exclude ("org.typelevel", "scala-library"),
"io.frees" %% "frees-async-cats-effect" % V.frees exclude ("org.typelevel", "scala-library")
)

def n(suffix: String) = s"metrifier-$suffix"
}

override def projectSettings: Seq[Def.Setting[_]] =
Expand All @@ -50,7 +55,20 @@ object ProjectPlugin extends AutoPlugin {
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.bintrayRepo("beyondthelines", "maven")
)
),
test in assembly := {},
assemblyOption in assembly := (assemblyOption in assembly).value
.copy(includeScala = false, includeDependency = false),
assemblyMergeStrategy in assembly := {
case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case "unwanted.txt" => MergeStrategy.discard
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)

}
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
Loading

0 comments on commit e8f825a

Please sign in to comment.