MCPcopy Create free account
hub / github.com/gogs/gogs / GetStatistic

Function GetStatistic

internal/database/models.go:212–235  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

210}
211
212func GetStatistic(ctx context.Context) (stats Statistic) {
213 stats.Counter.User = Handle.Users().Count(ctx)
214 stats.Counter.Org = CountOrganizations()
215 stats.Counter.PublicKey, _ = x.Count(new(PublicKey))
216 stats.Counter.Repo = CountRepositories(true)
217 stats.Counter.Watch, _ = x.Count(new(Watch))
218 stats.Counter.Star, _ = x.Count(new(Star))
219 stats.Counter.Action, _ = x.Count(new(Action))
220 stats.Counter.Access, _ = x.Count(new(Access))
221 stats.Counter.Issue, _ = x.Count(new(Issue))
222 stats.Counter.Comment, _ = x.Count(new(Comment))
223 stats.Counter.Oauth = 0
224 stats.Counter.Follow, _ = x.Count(new(Follow))
225 stats.Counter.Mirror, _ = x.Count(new(Mirror))
226 stats.Counter.Release, _ = x.Count(new(Release))
227 stats.Counter.LoginSource = Handle.LoginSources().Count(ctx)
228 stats.Counter.Webhook, _ = x.Count(new(Webhook))
229 stats.Counter.Milestone, _ = x.Count(new(Milestone))
230 stats.Counter.Label, _ = x.Count(new(Label))
231 stats.Counter.HookTask, _ = x.Count(new(HookTask))
232 stats.Counter.Team, _ = x.Count(new(Team))
233 stats.Counter.Attachment, _ = x.Count(new(Attachment))
234 return stats
235}
236
237func Ping() error {
238 if x == nil {

Callers 1

DashboardFunction · 0.92

Calls 5

CountOrganizationsFunction · 0.85
CountRepositoriesFunction · 0.85
UsersMethod · 0.80
LoginSourcesMethod · 0.80
CountMethod · 0.45

Tested by

no test coverage detected