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

Fix: Migrate to dedicated station count endpoints #93

Conversation

PatrickNercessian
Copy link
Collaborator

Roadmap Issue: CheckerNetwork/roadmap#97

Follow up to #71

lib/request-helpers.js Outdated Show resolved Hide resolved
@PatrickNercessian PatrickNercessian force-pushed the fix-dedicated-platform-endpoints branch from cf9be9c to f4db89d Compare May 9, 2024 09:14
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Almost there!

* @param {import('./typings').Filter} args.filter
* @param {string} [args.asColumn]
*/
export const getDailyDistinctCountQuery = async ({
Copy link
Member

Choose a reason for hiding this comment

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

Since this function executes the query instead of returning the query, I think it should not have Query in the name.

Suggested change
export const getDailyDistinctCountQuery = async ({
export const getDailyDistinctCount = async ({

* @param {import('./typings').Filter} args.filter
* @param {string} [args.asColumn]
*/
export const getMonthlyDistinctCountQuery = async ({
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Suggested change
export const getMonthlyDistinctCountQuery = async ({
export const getMonthlyDistinctCount = async ({

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@juliangruber do you have any more comments?

await assertResponseStatus(res, 200)
const metrics = await res.json()
assert.deepStrictEqual(metrics, [
{ month: '2024-01-01', station_id_count: 3 },
Copy link
Member

Choose a reason for hiding this comment

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

I have mixed feelings about the name station_id_count. I slightly prefer to use stations (we use participants in GET /participants/daily) or even count.

However, I also see how station_id_count is a very descriptive & accurate name, so I am fine to keep it.

Copy link
Member

Choose a reason for hiding this comment

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

I like how precise it is, also it is a bit leaky (potentially exposes too many internals). I suggest we iterate on this at a later point, when we understand our system better

Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

Nice! Nothing to add to @bajtos's reviews :)

@juliangruber juliangruber merged commit 5e1b373 into CheckerNetwork:main May 10, 2024
6 checks passed
PatrickNercessian added a commit to PatrickNercessian/spark-stats that referenced this pull request May 12, 2024
* Migrate to dedicated station count endpoints

* Improved local helper function SQL security

* Renamed request helper methods
PatrickNercessian added a commit to PatrickNercessian/spark-stats that referenced this pull request May 12, 2024
* Migrate to dedicated station count endpoints

* Improved local helper function SQL security

* Renamed request helper methods
bajtos added a commit that referenced this pull request May 13, 2024
* Add honest_measurement_count platform stat

* Switched to new column name for measurement count

* Fix: Migrate to dedicated station count endpoints (#93)

* Migrate to dedicated station count endpoints

* Improved local helper function SQL security

* Renamed request helper methods

* Add honest_measurement_count platform stat

---------

Co-authored-by: Miroslav Bajtoš <oss@bajtos.net>
@PatrickNercessian PatrickNercessian deleted the fix-dedicated-platform-endpoints branch July 1, 2024 13:47
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.

3 participants