Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 85 additions & 82 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"start": "npm --prefix test-worker run start"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240821.1",
"@types/jest": "^29.5.12",
"@cloudflare/workers-types": "^4.20241205.0",
"@types/jest": "^29.5.14",
"@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "8.3.0",
"@typescript-eslint/parser": "8.3.0",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"eslint": "^8.57.0",
"eslint-plugin-prettierx": "github:utily/eslint-plugin-prettierx#utily-20231004",
"eslint-plugin-simple-import-sort": "^12.1.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/administration/Listener/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export abstract class BaseListener<C extends BaseListener.Configuration> {
* Returns status of the listener.
* Override `getStatus` instead to add details.
*/
async getStatus() {
const result: BaseListener.StatusResult = await this.addStatusDetails({ ok: true })
async getStatus(statistics?: boolean) {
const result: BaseListener.StatusResult = await this.addStatusDetails({ ok: true }, (statistics = false))
// TODO: Get statistics from bucket.
return result
}
Expand All @@ -34,7 +34,7 @@ export abstract class BaseListener<C extends BaseListener.Configuration> {
* This is a stub, made to be overridden.
* Override this to add details.
*/
async addStatusDetails(result: BaseListener.StatusResult): Promise<BaseListener.StatusResult> {
async addStatusDetails(result: BaseListener.StatusResult, statistics?: boolean): Promise<BaseListener.StatusResult> {
return result
}

Expand Down
7 changes: 5 additions & 2 deletions packages/administration/Listener/BigQuery/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ export namespace BigQuery {
return { ...bigQueryConfiguration, privateKey, errorHandler, logger }
}
export class Implementation extends BaseListener<BigQuery> {
async addStatusDetails(result: BaseListener.StatusResult): Promise<BaseListener.StatusResult> {
async addStatusDetails(
result: BaseListener.StatusResult,
statistics?: boolean
): Promise<BaseListener.StatusResult> {
const bigQueryApi = new BigQueryApi(this.configuration)
;(result.details ??= {}).table = await bigQueryApi.getTable()
;(result.details ??= {}).table = await bigQueryApi.getTable(statistics ? "STORAGE_STATS" : undefined)
return result
}
getConfiguration() {
Expand Down
2 changes: 1 addition & 1 deletion packages/administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cloudly-analytics-common": "^0.3.33",
"cloudly-http": "^0.1.7",
"cloudly-router": "^0.1.1",
"cloudly-storage": "^0.10.15",
"cloudly-storage": "^0.10.16",
"gracely": "^2.0.8",
"isly": "^0.1.20",
"isoly": "^2.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class TypescriptApi extends Base {
return result
}

async fetch(name: string): Promise<FetchResult | undefined> {
async fetch(name: string, statistics?: boolean): Promise<FetchResult | undefined> {
let result: FetchResult | undefined
const listenerConfiguration = await this.getListenerConfiguration(name)
if (!listenerConfiguration) {
Expand All @@ -40,7 +40,7 @@ export class TypescriptApi extends Base {
const listener = Listener.create(listenerConfiguration)
result = {
configuration: listener.getConfiguration(),
status: await listener.getStatus(),
status: await listener.getStatus(statistics),
readonly: true,
}
}
Expand Down
Loading
Loading