Skip to content

Commit

Permalink
Fix laws and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasilis Nicolaou committed Dec 1, 2018
1 parent 6e88363 commit cf1d73d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 22 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Talos is a set of tools for enabling fine grained monitoring of the Akka and mon
Talos is modularised. You can twist it and pick the dependencies that fit your need. But let's go step by step.

```scala
libraryDependencies += "org.vaslabs.talos" %% "taloscore" % "0.5.0"
libraryDependencies += "org.vaslabs.talos" %% "talosakkasupport" % "0.5.0"
libraryDependencies += "org.vaslabs.talos" %% "taloskamon" % "0.5.0"
libraryDependencies += "org.vaslabs.talos" %% "hystrixreporter" % "0.5.0"
libraryDependencies += "org.vaslabs.talos" %% "taloscore" % "0.5.1"
libraryDependencies += "org.vaslabs.talos" %% "talosakkasupport" % "0.5.1"
libraryDependencies += "org.vaslabs.talos" %% "taloskamon" % "0.5.1"
libraryDependencies += "org.vaslabs.talos" %% "hystrixreporter" % "0.5.1"
```
The events library provides a way to stream events on what's happening in the circuit breakers. E.g. combining with the talosakkasupport you can do:
```scala
Expand Down Expand Up @@ -86,7 +86,7 @@ https://github.com/vaslabs/talos/blob/master/examples/src/main/scala/talos/examp
### Laws
If you wish to implement your own TalosCircuitBreaker typeclasses you can test them against the laws library:
```scala
libraryDependencies += "org.vaslabs.talos" %% "taloslaws" % "0.5.0" % Test
libraryDependencies += "org.vaslabs.talos" %% "taloslaws" % "0.5.1" % Test
```


Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ lazy val compilerSettings = {
lazy val talosCore =
(project in file("core"))
.settings(
libraryDependencies ++= Seq(libraries.ScalaTest.scalatest, libraries.Cats.effect, libraries.ScalaTest.scalacheck)
libraryDependencies ++= Seq(libraries.ScalaTest.scalatest % Test, libraries.Cats.effect)
).settings(
compilerSettings
).settings(publishSettings)

lazy val talosLaws = (project in file("laws"))
.settings(
libraryDependencies ++= libraries.ScalaTest.all
libraryDependencies ++= libraries.ScalaCheck.all
).settings(
compilerSettings
).settings(
Expand Down
16 changes: 8 additions & 8 deletions laws/src/main/scala/talos/laws/EventBusLaws.scala
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package talos.laws

import talos.circuitbreakers.EventBus
import org.scalacheck._
import Gen._
import org.scalatest.Matchers
import talos.events.TalosEvents.model.{CircuitBreakerEvent, SuccessfulCall}
import talos.circuitbreakers.EventBus
import talos.events.TalosEvents.model.CircuitBreakerEvent
import org.scalacheck.ScalacheckShapeless._

trait EventBusLaws[S] extends Matchers{
def acceptMsg: CircuitBreakerEvent

implicit def eventBus: EventBus[S]

private def genSuccessfulCall: Gen[SuccessfulCall] = for {
elapsedTime <- finiteDuration
name <- alphaNumStr
} yield SuccessfulCall(name, elapsedTime)


private[laws] def canConsumeMessagesPublishedToTheEventBus = {
val successfulCall = genSuccessfulCall.sample.get

val circuitBreakerEvent = implicitly[Arbitrary[CircuitBreakerEvent]]

val successfulCall = circuitBreakerEvent.arbitrary.sample.get

eventBus publish successfulCall

Expand Down
9 changes: 8 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import sbt._
object Dependencies {

object versions {
val scalacheckshapeless: String = "1.2.0"

val scalcheck: String = "1.14.0"

val pureconfig: String = "0.10.0"
Expand Down Expand Up @@ -66,10 +68,15 @@ object Dependencies {

object ScalaTest {
val scalatest = "org.scalatest" %% "scalatest" % versions.scalatest
val scalacheck = "org.scalacheck" %% "scalacheck" % versions.scalcheck
val all = Seq(scalatest % Test)
}

object ScalaCheck {
val scalacheck = "org.scalacheck" %% "scalacheck" % versions.scalcheck
val scalacheckshapeless = "com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % versions.scalacheckshapeless
val all = Seq(scalacheck, scalacheckshapeless, ScalaTest.scalatest)
}

object PureConf {
val core = "com.github.pureconfig" %% "pureconfig" % versions.pureconfig
}
Expand Down
2 changes: 1 addition & 1 deletion site/src/main/tut/dashboard/hystrixDashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ deliver fine grained visualisations.
### Usage

```scala
libraryDependencies += "org.vaslabs.talos" %% "hystrixreporter" % "0.5.0"
libraryDependencies += "org.vaslabs.talos" %% "hystrixreporter" % "0.5.1"
```

Get an akka directive
Expand Down
4 changes: 2 additions & 2 deletions site/src/main/tut/events/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ This is the basic documentation for exposing the Akka circuit breaker events. Fo

```scala
libraryDependencies ++= Seq(
"org.vaslabs.talos" %% "taloscore" % "0.5.0",
"org.vaslabs.talos" %% "talosakkasupport" % "0.5.0"
"org.vaslabs.talos" %% "taloscore" % "0.5.1",
"org.vaslabs.talos" %% "talosakkasupport" % "0.5.1"
)
```
## Usage example
Expand Down
2 changes: 1 addition & 1 deletion site/src/main/tut/kamon/kamon.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ number: 2
## Dependency

```scala
libraryDependencies += "org.vaslabs.talos" %% "taloskamon" % "0.5.0"
libraryDependencies += "org.vaslabs.talos" %% "taloskamon" % "0.5.1"
```

```tut:silent
Expand Down
4 changes: 2 additions & 2 deletions site/src/main/tut/monix/monix.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ To use monix declare the talos monix support dependency.

```scala
libraryDependencies ++= Seq(
"org.vaslabs.talos" %% "taloscore" % "0.5.0",
"org.vaslabs.talos" %% "talosmonixsupport" % "0.5.0"
"org.vaslabs.talos" %% "taloscore" % "0.5.1",
"org.vaslabs.talos" %% "talosmonixsupport" % "0.5.1"
)
```

Expand Down

0 comments on commit cf1d73d

Please sign in to comment.