Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage metrics for 2024.3 release #1345

Merged
merged 10 commits into from
Dec 14, 2024
Merged

Usage metrics for 2024.3 release #1345

merged 10 commits into from
Dec 14, 2024

Conversation

ktuite
Copy link
Member

@ktuite ktuite commented Dec 12, 2024

Closes getodk/central#722

Based on this PR where I change Promise.all to runSequentially for the bulk analytics queries. #1344

What has been done to verify that this works as intended?

Why is this the best possible solution? Were any other approaches considered?

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@ktuite ktuite linked an issue Dec 12, 2024 that may be closed by this pull request
12 tasks
Base automatically changed from ktuite/analyticsQueries to master December 12, 2024 21:41
@ktuite ktuite changed the title Beginning to add new usage metrics for 2024.3 release Usage metrics for 2024.3 release Dec 12, 2024
@ktuite ktuite force-pushed the ktuite/usageMetrics branch from c7180e7 to c4c8501 Compare December 12, 2024 21:48
@ktuite ktuite marked this pull request as ready for review December 13, 2024 21:02
Copy link
Member

@matthew-white matthew-white left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had time to take a close look at this and probably won't have time to today. In particular, I haven't looked at tests at all. That said, things are looking good so far. 👍 I think we should go ahead and merge, then I'll review further later. I'll leave a comment on the issue or file a new issue if I notice anything.

lib/model/query/analytics.js Outdated Show resolved Hide resolved
THEN 1 ELSE 0 END) create_api_recent,
e."datasetId"
FROM audits a
JOIN entities e on CAST((a.details ->> 'entityId'::TEXT) AS integer) = e.id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ::TEXT needed?

@@ -450,6 +477,33 @@ FROM datasets ds
WHERE a."action" = 'entity.update.version'
GROUP BY e."datasetId"
) as updates ON ds.id = updates."datasetId"
LEFT JOIN (
SELECT
COUNT (1) total,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we usually don't leave a space between the function name and the parentheses.

@ktuite ktuite merged commit efdbc3a into master Dec 14, 2024
11 checks passed
@ktuite ktuite deleted the ktuite/usageMetrics branch December 14, 2024 00:59
@matthew-white
Copy link
Member

I've taken a closer look at everything except for tests, and things are looking good. 👍 @ktuite, how about we review tests interactively at some point?


const datasets = await container.Analytics.getDatasets();

datasets[0].num_entity_create_sub_total.should.be.equal(0);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run the worker and assert that this is not zero

Copy link
Member

@matthew-white matthew-white left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looked at tests with @ktuite, and those are looking good. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update usage information metrics for v2024.3
2 participants