This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from stijndehaes/play-2.6
Play 2.6
- Loading branch information
Showing
14 changed files
with
107 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
language: scala | ||
scala: | ||
- 2.11.11 | ||
- 2.12.2 | ||
cache: | ||
directories: | ||
- $HOME/.m2/repository | ||
- $HOME/.sbt | ||
- $HOME/.ivy2 | ||
jdk: | ||
- oraclejdk8 | ||
script: | ||
- sbt clean coverage test coverageReport | ||
- sbt ++$TRAVIS_SCALA_VERSION clean coverage test coverageReport | ||
after_success: | ||
- sbt coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
app/com/github/stijndehaes/playprometheusfilters/PrometheusModule.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package com.github.stijndehaes.playprometheusfilters | ||
|
||
import com.google.inject.AbstractModule | ||
import play.api.inject.{Binding, Module} | ||
import play.api.{Configuration, Environment} | ||
import io.prometheus.client.CollectorRegistry | ||
|
||
class PrometheusModule extends AbstractModule { | ||
class PrometheusModule extends Module { | ||
|
||
override def bindings(environment: Environment, configuration: Configuration): Seq[Binding[_]] = Seq( | ||
bind[CollectorRegistry].to(CollectorRegistry.defaultRegistry) | ||
) | ||
|
||
override def configure(): Unit = { | ||
bind(classOf[CollectorRegistry]).toInstance(CollectorRegistry.defaultRegistry) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// The Play plugin | ||
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.15") | ||
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.2") | ||
|
||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") | ||
|
||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5") | ||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0") | ||
|
||
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.1.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/com/github/stijndehaes/playprometheusfilters/mocks/MockController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.stijndehaes.playprometheusfilters.mocks | ||
|
||
import javax.inject.Inject | ||
|
||
import play.api.mvc.{AbstractController, ControllerComponents} | ||
|
||
class MockController @Inject()(cc: ControllerComponents) extends AbstractController(cc) { | ||
|
||
def ok = Action { | ||
Ok("ok") | ||
} | ||
|
||
def error = Action { | ||
NotFound("error") | ||
} | ||
|
||
} |