monitor chat fetch

lila3
Thibault Duplessis 2019-12-12 10:29:31 -06:00
parent 3280e98abf
commit 22a93fe940
2 changed files with 5 additions and 1 deletions

View File

@ -214,7 +214,10 @@ final class Study(
ctx.me.fold(true) { // anon can see public chats
env.chat.panic.allowed
}
} ?? env.chat.api.userChat.findMine(Chat.Id(study.id.value), ctx.me).map(some)
} ?? env.chat.api.userChat
.findMine(Chat.Id(study.id.value), ctx.me)
.dmap(some)
.mon(_.chat.fetch("study"))
def createAs = AuthBody { implicit ctx => me =>
implicit val req = ctx.body

View File

@ -374,6 +374,7 @@ object mon {
}
object chat {
def message(troll: Boolean) = counter("chat.message").withTag("troll", troll)
def fetch(parent: String) = timer("chat.fetch").withTag("parent", parent)
}
object push {
object register {