Function to get unique number of users in a certain time period#5
Open
ateucher wants to merge 14 commits into
Open
Function to get unique number of users in a certain time period#5ateucher wants to merge 14 commits into
ateucher wants to merge 14 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new exported helper to count distinct workshop users (or list users) over a time window via Prometheus/Grafana queries, along with supporting utilities, docs, and tests.
Changes:
- Add
get_workshop_users()(summary mode and per-user mode with first/last seen estimates). - Refactor
unsanitize_dir_names()to decode patterns atomically and vectorize behavior; addglue_promql()helper for PromQL-safe templating. - Extend test coverage for the new functionality and update generated docs/metadata.
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-utils.R | Adds regression tests for vectorized + atomic decoding in unsanitize_dir_names(). |
| tests/testthat/test-prometheus-usage-summaries.R | Adds tests for get_workshop_users() (live + mocked) and minor mock readability change. |
| R/utils.R | Refactors unsanitize_dir_names() and introduces glue_promql() helper. |
| R/prometheus-usage-summaries.R | Uses glue_promql() in existing queries and adds get_workshop_users(). |
| NAMESPACE | Exports get_workshop_users(). |
| man/unsanitize_dir_names.Rd | Regenerated doc reflecting punctuation change. |
| man/jupycost-package.Rd | Regenerated package Rd with author section changes. |
| man/get_workshop_users.Rd | New generated Rd for get_workshop_users(). |
| DESCRIPTION | Updates roxygen metadata fields. |
Files not reviewed (3)
- man/get_workshop_users.Rd: Generated file
- man/jupycost-package.Rd: Generated file
- man/unsanitize_dir_names.Rd: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 10 changed files in this pull request and generated 4 comments.
Files not reviewed (3)
- man/get_workshop_users.Rd: Generated file
- man/jupycost-package.Rd: Generated file
- man/unsanitize_dir_names.Rd: Generated file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Default is for the workshop hub, can be
"prod"or all.