Re-add matrix event duration metric and move more things

This commit is contained in:
Tulir Asokan 2022-05-22 16:28:50 +03:00
parent 73304cd400
commit 86b9ae54d5
3 changed files with 4 additions and 8 deletions

2
go.mod
View file

@ -15,7 +15,7 @@ require (
golang.org/x/net v0.0.0-20220513224357-95641704303c golang.org/x/net v0.0.0-20220513224357-95641704303c
google.golang.org/protobuf v1.28.0 google.golang.org/protobuf v1.28.0
maunium.net/go/maulogger/v2 v2.3.2 maunium.net/go/maulogger/v2 v2.3.2
maunium.net/go/mautrix v0.11.1-0.20220522131515-87f89ec33247 maunium.net/go/mautrix v0.11.1-0.20220522132814-7f7f4896f884
) )
require ( require (

4
go.sum
View file

@ -107,5 +107,5 @@ maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA= maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
maunium.net/go/maulogger/v2 v2.3.2 h1:1XmIYmMd3PoQfp9J+PaHhpt80zpfmMqaShzUTC7FwY0= maunium.net/go/maulogger/v2 v2.3.2 h1:1XmIYmMd3PoQfp9J+PaHhpt80zpfmMqaShzUTC7FwY0=
maunium.net/go/maulogger/v2 v2.3.2/go.mod h1:TYWy7wKwz/tIXTpsx8G3mZseIRiC5DoMxSZazOHy68A= maunium.net/go/maulogger/v2 v2.3.2/go.mod h1:TYWy7wKwz/tIXTpsx8G3mZseIRiC5DoMxSZazOHy68A=
maunium.net/go/mautrix v0.11.1-0.20220522131515-87f89ec33247 h1:Hi90NviwsdYIY9/N6S4uZQuqPuHf/a2jYud4kC9tTcc= maunium.net/go/mautrix v0.11.1-0.20220522132814-7f7f4896f884 h1:qmr5phNOqbxHhVkZCsSUSSmk5qHSoiU1wtz9rSG5SdY=
maunium.net/go/mautrix v0.11.1-0.20220522131515-87f89ec33247/go.mod h1:oma8o6Y/5jcViBlDbX7tp1ajP2XP+b78h8twdI+zKI0= maunium.net/go/mautrix v0.11.1-0.20220522132814-7f7f4896f884/go.mod h1:oma8o6Y/5jcViBlDbX7tp1ajP2XP+b78h8twdI+zKI0=

View file

@ -81,6 +81,7 @@ type WABridge struct {
func (br *WABridge) Init() { func (br *WABridge) Init() {
br.CommandProcessor = commands.NewProcessor(&br.Bridge) br.CommandProcessor = commands.NewProcessor(&br.Bridge)
br.RegisterCommands() br.RegisterCommands()
br.MatrixHandler.TrackEventDuration = br.Metrics.TrackMatrixEvent
// TODO this is a weird place for this // TODO this is a weird place for this
br.EventProcessor.On(event.EphemeralEventPresence, br.HandlePresence) br.EventProcessor.On(event.EphemeralEventPresence, br.HandlePresence)
@ -228,12 +229,7 @@ func (br *WABridge) StartUsers() {
} }
func (br *WABridge) Stop() { func (br *WABridge) Stop() {
if br.Crypto != nil {
br.Crypto.Stop()
}
br.AS.Stop()
br.Metrics.Stop() br.Metrics.Stop()
br.EventProcessor.Stop()
for _, user := range br.usersByUsername { for _, user := range br.usersByUsername {
if user.Client == nil { if user.Client == nil {
continue continue