-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WS image metrics to workspace instances (#20426)
* Add WS image metrics to workspace instances * Update tests * fix ws-manager-api field description * Prefer existing DB values for metrics * Copy proto comments over to protocol type
- Loading branch information
1 parent
c4d3eb3
commit 5bb738a
Showing
25 changed files
with
2,240 additions
and
589 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
components/gitpod-db/src/typeorm/migration/1733397172273-AddWorkspaceInstanceMetrics.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (c) 2024 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License.AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { columnExists } from "./helper/helper"; | ||
|
||
const table = "d_b_workspace_instance"; | ||
const newColumn = "metrics"; | ||
|
||
export class AddWorkspaceInstanceMetrics1733397172273 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
if (!(await columnExists(queryRunner, table, newColumn))) { | ||
await queryRunner.query(`ALTER TABLE ${table} ADD COLUMN ${newColumn} JSON NULL`); | ||
} | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
if (await columnExists(queryRunner, table, newColumn)) { | ||
await queryRunner.query(`ALTER TABLE ${table} DROP COLUMN ${newColumn}`); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.