fishnet http monitoring
parent
73061951f7
commit
81d2d864b8
|
@ -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 =>
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue