public virtual JsonResult Stats()
        {
            var stats = statsSvc.GetAggregateStats();

            return(Json(new
            {
                Downloads = stats.Downloads.ToString("n0"),
                UniquePackages = stats.UniquePackages.ToString("n0"),
                TotalPackages = stats.TotalPackages.ToString("n0")
            }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public virtual JsonResult Stats()
        {
            var stats = statsSvc.GetAggregateStats();

            return(Json(
                       new
            {
                Downloads = stats.Downloads.ToString("n0"),
                UniquePackages = stats.UniquePackages.ToString("n0"),
                TotalPackages = stats.TotalPackages.ToString("n0"),
                PackagesReadyForReviewModeration = stats.PackagesReadyForReviewModeration.ToString("n0"),
                TotalPackagesInModeration = stats.TotalPackagesInModeration.ToString("n0"),
                AverageModerationWaitTimeHours = stats.AverageModerationWaitTimeHours.ToString("n0"),
                UpToDatePackages = stats.UpToDatePackages.ToString("n0"),
                OlderThanOneYearPackages = stats.OlderThanOneYearPackages.ToString("n0"),
                ApprovedPackages = stats.ApprovedPackages.ToString("n0"),
                TotalApprovedPackages = stats.TotalApprovedPackages.ToString("n0"),
                ManuallyApprovedPackages = stats.ManuallyApprovedPackages.ToString("n0"),
                TotalManuallyApprovedPackages = stats.TotalManuallyApprovedPackages.ToString("n0"),
                TrustedPackages = stats.TrustedPackages.ToString("n0"),
                TotalTrustedPackages = stats.TotalTrustedPackages.ToString("n0"),
                TotalRejectedPackages = stats.TotalRejectedPackages.ToString("n0"),
                ExemptedPackages = stats.ExemptedPackages.ToString("n0"),
                TotalExemptedPackages = stats.TotalExemptedPackages.ToString("n0"),
                UnknownPackages = stats.UnknownPackages.ToString("n0"),
                TotalUnknownPackages = stats.TotalUnknownPackages.ToString("n0"),
                LatestPackagePrerelease = stats.LatestPackagePrerelease.ToString("n0"),
                TotalUnlistedPackages = stats.TotalUnlistedPackages.ToString("n0"),
                PackagesWithPackageSource = stats.PackagesWithPackageSource.ToString("n0"),
                PackagesPassingVerification = stats.PackagesPassingVerification.ToString("n0"),
                PackagesFailingVerification = stats.PackagesFailingVerification.ToString("n0"),
                PackagesPassingValidation = stats.PackagesPassingValidation.ToString("n0"),
                PackagesFailingValidation = stats.PackagesFailingValidation.ToString("n0"),
                PackagesCached = stats.PackagesCached.ToString("n0"),
                TotalPackagesCached = stats.TotalPackagesCached.ToString("n0"),
                PackagesCachedAvailable = stats.PackagesCachedAvailable.ToString("n0"),
                TotalPackagesCachedAvailable = stats.TotalPackagesCachedAvailable.ToString("n0"),
                PackagesCachedInvestigate = stats.PackagesCachedInvestigate.ToString("n0"),
                TotalPackagesCachedInvestigate = stats.TotalPackagesCachedInvestigate.ToString("n0"),
                PackagesScanned = stats.PackagesScanned.ToString("n0"),
                TotalPackagesScanned = stats.TotalPackagesScanned.ToString("n0"),
                PackagesScannedNotFlagged = stats.PackagesScannedNotFlagged.ToString("n0"),
                TotalPackagesScannedNotFlagged = stats.TotalPackagesScannedNotFlagged.ToString("n0"),
                PackagesScannedFlagged = stats.PackagesScannedFlagged.ToString("n0"),
                TotalPackagesScannedFlagged = stats.TotalPackagesScannedFlagged.ToString("n0"),
                PackagesScannedExempted = stats.PackagesScannedExempted.ToString("n0"),
                TotalPackagesScannedExempted = stats.TotalPackagesScannedExempted.ToString("n0"),
                PackagesScannedInvestigate = stats.PackagesScannedInvestigate.ToString("n0"),
                TotalPackagesScannedInvestigate = stats.TotalPackagesScannedInvestigate.ToString("n0"),
                TotalFileScanOverlaps = stats.TotalFileScanOverlaps.ToString("n0"),
                TotalFileScans = stats.TotalFileScans.ToString("n0")
            }, JsonRequestBehavior.AllowGet));
        }
        public virtual async Task <ActionResult> Totals()
        {
            var stats = await _aggregateStatsService.GetAggregateStats();

            return(Json(
                       new
            {
                Downloads = stats.Downloads,
                UniquePackages = stats.UniquePackages,
                TotalPackages = stats.TotalPackages,
                LastUpdatedDateUtc = stats.LastUpdateDateUtc
            },
                       JsonRequestBehavior.AllowGet));
        }
Exemple #4
0
        public virtual JsonResult Totals()
        {
            var stats = _aggregateStatsService.GetAggregateStats();

            // if we fail to detect client locale from the Languages header, fall back to server locale
            CultureInfo clientCulture = DetermineClientLocale() ?? CultureInfo.CurrentCulture;

            return(Json(
                       new
            {
                Downloads = stats.Downloads.ToString("n0", clientCulture),
                UniquePackages = stats.UniquePackages.ToString("n0", clientCulture),
                TotalPackages = stats.TotalPackages.ToString("n0", clientCulture)
            },
                       JsonRequestBehavior.AllowGet));
        }