-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/subtivity #52
Conversation
src/clickhouse/stores.ts
Outdated
|
||
private fetchData() { | ||
this.ChainsPromise = client | ||
.query({ query: "SELECT DISTINCT chain FROM blocks", format: "JSONEachRow" }) |
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 think we could replace blocks
=> module_hashes
and it will be much faster since there's only a few rows
src/config.ts
Outdated
@@ -15,6 +15,7 @@ export const DEFAULT_MAX_LIMIT = 500; | |||
export const DEFAULT_VERBOSE = false; | |||
export const APP_NAME = pkg.name; | |||
export const DEFAULT_SORT_BY = "DESC"; | |||
export const DEFAULT_AGGREGATE_FUNCTION = "count"; |
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.
this should be sum
https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/sum
count
only counts the number of rows
https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/count
src/utils.ts
Outdated
@@ -68,3 +78,70 @@ export function parseTimestamp(timestamp?: string|null|number) { | |||
} | |||
return undefined; | |||
} | |||
|
|||
export function parseAggregateFunction(aggregate_function?: string|null) { | |||
if (aggregate_function == undefined || aggregate_function == null || aggregate_function == '') return "sum"; |
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.
This can be simplified to:
if (!aggregate_function) return "sum";
src/utils.ts
Outdated
} | ||
|
||
export function parseHistoryRange(range?: string|null) { | ||
if (range == undefined || range == '') return "24h"; |
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.
same simplified:
if (!range) return "24h";
No description provided.