-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix: Migrate to dedicated station count endpoints #93
Conversation
cf9be9c
to
f4db89d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
lib/request-helpers.js
Outdated
* @param {import('./typings').Filter} args.filter | ||
* @param {string} [args.asColumn] | ||
*/ | ||
export const getDailyDistinctCountQuery = async ({ |
There was a problem hiding this comment.
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.
export const getDailyDistinctCountQuery = async ({ | |
export const getDailyDistinctCount = async ({ |
lib/request-helpers.js
Outdated
* @param {import('./typings').Filter} args.filter | ||
* @param {string} [args.asColumn] | ||
*/ | ||
export const getMonthlyDistinctCountQuery = async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
export const getMonthlyDistinctCountQuery = async ({ | |
export const getMonthlyDistinctCount = async ({ |
There was a problem hiding this 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 }, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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 :)
* Migrate to dedicated station count endpoints * Improved local helper function SQL security * Renamed request helper methods
* Migrate to dedicated station count endpoints * Improved local helper function SQL security * Renamed request helper methods
* 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>
Roadmap Issue: CheckerNetwork/roadmap#97
Follow up to #71