1
0

Add prometheus endpoint for getting metrics (#33)

This commit is contained in:
konrad
2018-12-12 22:50:35 +00:00
committed by Gitea
parent ee398b5272
commit e047673c6b
189 changed files with 44128 additions and 94 deletions

View File

@ -16,7 +16,10 @@
package models
import "code.vikunja.io/web"
import (
"code.vikunja.io/api/pkg/metrics"
"code.vikunja.io/web"
)
// Create is the handler to create a team
// @Summary Creates a new team
@ -51,6 +54,10 @@ func (t *Team) Create(a web.Auth) (err error) {
// Insert the current user as member and admin
tm := TeamMember{TeamID: t.ID, UserID: doer.ID, Admin: true}
err = tm.Create(doer)
if err = tm.Create(doer); err != nil {
return err
}
metrics.UpdateCount(1, metrics.TeamCountKey)
return
}