|
10 | 10 | const config = require('config');
|
11 | 11 | const { sql } = require('slonik');
|
12 | 12 | const { clone } = require('ramda');
|
| 13 | +const { runSequentially } = require('../../util/promise'); |
13 | 14 | const { metricsTemplate } = require('../../data/analytics');
|
14 | 15 | const oidc = require('../../util/oidc');
|
15 | 16 |
|
@@ -557,24 +558,24 @@ JOIN submission_defs as sd
|
557 | 558 | const getProjectsWithDescriptions = () => ({ all }) => all(sql`
|
558 | 559 | select id as "projectId", length(trim(description)) as description_length from projects where coalesce(trim(description),'')!=''`);
|
559 | 560 |
|
560 |
| -const projectMetrics = () => (({ Analytics }) => Promise.all([ |
561 |
| - Analytics.countUsersPerRole(), |
562 |
| - Analytics.countAppUsers(), |
563 |
| - Analytics.countDeviceIds(), |
564 |
| - Analytics.countPublicLinks(), |
565 |
| - Analytics.countForms(), |
566 |
| - Analytics.countFormFieldTypes(), |
567 |
| - Analytics.countFormsEncrypted(), |
568 |
| - Analytics.countFormsInStates(), |
569 |
| - Analytics.countReusedFormIds(), |
570 |
| - Analytics.countSubmissions(), |
571 |
| - Analytics.countSubmissionReviewStates(), |
572 |
| - Analytics.countSubmissionsEdited(), |
573 |
| - Analytics.countSubmissionsComments(), |
574 |
| - Analytics.countSubmissionsByUserType(), |
575 |
| - Analytics.getProjectsWithDescriptions(), |
576 |
| - Analytics.getDatasets(), |
577 |
| - Analytics.getDatasetEvents() |
| 561 | +const projectMetrics = () => (({ Analytics }) => runSequentially([ |
| 562 | + Analytics.countUsersPerRole, |
| 563 | + Analytics.countAppUsers, |
| 564 | + Analytics.countDeviceIds, |
| 565 | + Analytics.countPublicLinks, |
| 566 | + Analytics.countForms, |
| 567 | + Analytics.countFormFieldTypes, |
| 568 | + Analytics.countFormsEncrypted, |
| 569 | + Analytics.countFormsInStates, |
| 570 | + Analytics.countReusedFormIds, |
| 571 | + Analytics.countSubmissions, |
| 572 | + Analytics.countSubmissionReviewStates, |
| 573 | + Analytics.countSubmissionsEdited, |
| 574 | + Analytics.countSubmissionsComments, |
| 575 | + Analytics.countSubmissionsByUserType, |
| 576 | + Analytics.getProjectsWithDescriptions, |
| 577 | + Analytics.getDatasets, |
| 578 | + Analytics.getDatasetEvents |
578 | 579 | ]).then(([ userRoles, appUsers, deviceIds, pubLinks,
|
579 | 580 | forms, formGeoRepeats, formsEncrypt, formStates, reusedIds,
|
580 | 581 | subs, subStates, subEdited, subComments, subUsers,
|
@@ -725,24 +726,24 @@ const projectMetrics = () => (({ Analytics }) => Promise.all([
|
725 | 726 | return projArray;
|
726 | 727 | }));
|
727 | 728 |
|
728 |
| -const previewMetrics = () => (({ Analytics }) => Promise.all([ |
729 |
| - Analytics.databaseSize(), |
730 |
| - Analytics.encryptedProjects(), |
731 |
| - Analytics.biggestForm(), |
732 |
| - Analytics.countAdmins(), |
733 |
| - Analytics.auditLogs(), |
734 |
| - Analytics.archivedProjects(), |
735 |
| - Analytics.countUniqueManagers(), |
736 |
| - Analytics.countUniqueViewers(), |
737 |
| - Analytics.countUniqueDataCollectors(), |
738 |
| - Analytics.countClientAuditAttachments(), |
739 |
| - Analytics.countClientAuditProcessingFailed(), |
740 |
| - Analytics.countClientAuditRows(), |
741 |
| - Analytics.countOfflineBranches(), |
742 |
| - Analytics.countInterruptedBranches(), |
743 |
| - Analytics.countSubmissionReprocess(), |
744 |
| - Analytics.measureEntityProcessingTime(), |
745 |
| - Analytics.projectMetrics() |
| 729 | +const previewMetrics = () => (({ Analytics }) => runSequentially([ |
| 730 | + Analytics.databaseSize, |
| 731 | + Analytics.encryptedProjects, |
| 732 | + Analytics.biggestForm, |
| 733 | + Analytics.countAdmins, |
| 734 | + Analytics.auditLogs, |
| 735 | + Analytics.archivedProjects, |
| 736 | + Analytics.countUniqueManagers, |
| 737 | + Analytics.countUniqueViewers, |
| 738 | + Analytics.countUniqueDataCollectors, |
| 739 | + Analytics.countClientAuditAttachments, |
| 740 | + Analytics.countClientAuditProcessingFailed, |
| 741 | + Analytics.countClientAuditRows, |
| 742 | + Analytics.countOfflineBranches, |
| 743 | + Analytics.countInterruptedBranches, |
| 744 | + Analytics.countSubmissionReprocess, |
| 745 | + Analytics.measureEntityProcessingTime, |
| 746 | + Analytics.projectMetrics |
746 | 747 | ]).then(([db, encrypt, bigForm, admins, audits,
|
747 | 748 | archived, managers, viewers, collectors,
|
748 | 749 | caAttachments, caFailures, caRows,
|
|
0 commit comments