fishnet http monitoring

pull/5426/head
Thibault Duplessis 2019-08-13 17:40:56 +02:00
parent 73061951f7
commit 81d2d864b8
2 changed files with 10 additions and 1 deletions

View File

@ -17,7 +17,10 @@ object Fishnet extends LilaController {
private val logger = lila.log("fishnet")
def acquire = ClientAction[JsonApi.Request.Acquire] { req => client =>
api acquire client map Right.apply
api acquire client addEffect { jobOpt =>
val mon = lila.mon.fishnet.http.acquire(client.skill.toString)
if (jobOpt.isDefined) mon.hit() else mon.miss()
} map Right.apply
}
def move(workId: String) = ClientAction[JsonApi.Request.PostMove] { data => client =>

View File

@ -641,6 +641,12 @@ object mon {
val requestCount = inc("fishnet.analysis.request")
val evalCacheHits = rec("fishnet.analysis.eval_cache_hits")
}
object http {
def acquire(skill: String) = new {
def hit = inc(s"fishnet.http.acquire.$skill.hit")
def miss = inc(s"fishnet.http.acquire.$skill.miss")
}
}
}
object api {
object userGames {