Skip to content

Commit

Permalink
Change healthcheck API to report open circuits but return "GREEN" any…
Browse files Browse the repository at this point in the history
…ways
  • Loading branch information
seratch committed Apr 8, 2015
1 parent acbbffe commit 93bf175
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/system/HealthcheckController.scala
Expand Up @@ -45,7 +45,7 @@ class HealthcheckController(configsRepo: ConfigsRepository,
"hystrix" -> hystrixStatus,
"memcached" -> memcachedStatus
)
val colour = calculateColour(statuses.values)
val colour = calculateColour(statuses.filterKeys(_ != "hystrix").values)
val health = ServiceHealth(colour, statuses)
logIfUnhealthy(health)
health
Expand Down
5 changes: 3 additions & 2 deletions test/controllers/system/HealthcheckControllerSpec.scala
Expand Up @@ -80,11 +80,12 @@ class HealthcheckControllerSpec
}
}

it should "be YELLOW and show Hystrix as not OK if there are any open Hystrix circuits" in {
it should "be GREEN and show Hystrix as not OK if there are any open Hystrix circuits" in {
when(hystrixHealthReporter.getCommandKeysWithOpenCircuitBreakers).thenReturn(Seq("mrkun", "career"))

checkJson(controller.healthcheck.apply(FakeRequest())) { implicit json =>
colour should be("YELLOW")
// https://github.com/m3dev/octoparts/pull/150
colour should be("GREEN")
hystrixOk shouldBe false
}
}
Expand Down

0 comments on commit 93bf175

Please sign in to comment.