diff --git a/models/summary_statistic.go b/models/summary_statistic.go index 0addd472b..e5cf54b75 100644 --- a/models/summary_statistic.go +++ b/models/summary_statistic.go @@ -40,6 +40,11 @@ type SummaryStatistic struct { NumRepoLeagueLearn int `xorm:"NOT NULL DEFAULT 0"` NumRepoDataMining int `xorm:"NOT NULL DEFAULT 0"` NumRepoRISC int `xorm:"NOT NULL DEFAULT 0"` + NumRepoPublic int64 `xorm:"NOT NULL DEFAULT 0"` + NumRepoPrivate int64 `xorm:"NOT NULL DEFAULT 0"` + NumRepoFork int64 `xorm:"NOT NULL DEFAULT 0"` + NumRepoMirror int64 `xorm:"NOT NULL DEFAULT 0"` + NumRepoSelf int64 `xorm:"NOT NULL DEFAULT 0"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` } diff --git a/routers/repo/repo_statistic.go b/routers/repo/repo_statistic.go index 06f45e608..468e6fa85 100755 --- a/routers/repo/repo_statistic.go +++ b/routers/repo/repo_statistic.go @@ -110,6 +110,8 @@ func RepoStatisticDaily(date string) { Alias: repo.Alias, IsPrivate: repo.IsPrivate, IsMirror: repo.IsMirror, + IsFork: repo.IsFork, + RepoCreatedUnix: repo.CreatedUnix, OwnerName: repo.OwnerName, NumWatches: int64(repo.NumWatches), NumStars: int64(repo.NumStars), diff --git a/routers/repo/repo_summary_statistic.go b/routers/repo/repo_summary_statistic.go index 53270664c..3af31737c 100644 --- a/routers/repo/repo_summary_statistic.go +++ b/routers/repo/repo_summary_statistic.go @@ -39,6 +39,27 @@ func SummaryStatisticDaily(date string) { log.Error("can not get repository number", err) repositoryNumer = 0 } + + publicRepositoryNumer, err := models.GetAllPublicRepositoriesCount() + if err != nil { + log.Error("can not get public repository number", err) + publicRepositoryNumer = 0 + } + + privateRepositoryNumer := repositoryNumer - publicRepositoryNumer + + mirrorRepositoryNumber, err := models.GetAllMirrorRepositoriesCount() + if err != nil { + log.Error("can not get mirror repository number", err) + mirrorRepositoryNumber = 0 + } + forkRepositoryNumber, err := models.GetAllForkRepositoriesCount() + if err != nil { + log.Error("can not get fork mirror repository number", err) + forkRepositoryNumber = 0 + } + selfRepositoryNumber := repositoryNumer - mirrorRepositoryNumber - forkRepositoryNumber + //repository size repositorySize, err := models.GetAllRepositoriesSize() if err != nil { @@ -73,6 +94,11 @@ func SummaryStatisticDaily(date string) { DatasetSize: allDatasetSize, NumOrganizations: organizationNumber, NumRepos: repositoryNumer, + NumRepoFork: forkRepositoryNumber, + NumRepoMirror: mirrorRepositoryNumber, + NumRepoPrivate: privateRepositoryNumer, + NumRepoPublic: publicRepositoryNumer, + NumRepoSelf: selfRepositoryNumber, NumRepoBigModel: topicsCount[0], NumRepoAI: topicsCount[1], NumRepoVision: topicsCount[2],