Skip to content

Commit 39068e0

Browse files
committed
[api] Expose session.Metrics.InitializerMetrics
Tool: gitpod/catfood.gitpod.cloud
1 parent db69fe8 commit 39068e0

File tree

7 files changed

+3969
-453
lines changed

7 files changed

+3969
-453
lines changed

components/gitpod-protocol/src/protocol.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See License.AGPL.txt in the project root for license information.
55
*/
66

7-
import { WorkspaceInstance, PortVisibility, PortProtocol } from "./workspace-instance";
7+
import { WorkspaceInstance, PortVisibility, PortProtocol, WorkspaceInstanceMetrics } from "./workspace-instance";
88
import { RoleOrPermission } from "./permission";
99
import { Project } from "./teams-projects-protocol";
1010
import { createHash } from "crypto";
@@ -1390,6 +1390,7 @@ export namespace WorkspaceInstancePortsChangedEvent {
13901390
export interface WorkspaceSession {
13911391
workspace: Workspace;
13921392
instance: WorkspaceInstance;
1393+
metrics?: WorkspaceInstanceMetrics;
13931394
}
13941395
export interface WorkspaceInfo {
13951396
workspace: Workspace;

components/public-api/gitpod/v1/workspace.proto

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,39 @@ message WorkspaceSession {
939939

940940
// total_image_size is the total size of the image in bytes (includes Gitpod-specific layers like IDE)
941941
int64 total_image_size = 2;
942+
943+
// initializer_metrics are all metrics exported from the content initializer on workspace start
944+
InitializerMetrics initializer_metrics = 3;
945+
}
946+
947+
// Add these new message definitions
948+
message InitializerMetric {
949+
// Duration in nanoseconds (standard protobuf duration)
950+
google.protobuf.Duration duration = 1;
951+
952+
// Size in bytes
953+
uint64 size = 2;
954+
}
955+
956+
message InitializerMetrics {
957+
// Git contains metrics for the git initializer step
958+
InitializerMetric git = 1;
959+
960+
// FileDownload contains metrics for the file download initializer step
961+
InitializerMetric file_download = 2;
962+
963+
// Snapshot contains metrics for the snapshot initializer step
964+
// This used for workspaces started from snapshots.
965+
InitializerMetric snapshot = 3;
966+
967+
// Backup contains metrics for the backup initializer step
968+
InitializerMetric backup = 4;
969+
970+
// Prebuild contains metrics for the prebuild initializer step
971+
InitializerMetric prebuild = 5;
972+
973+
// Composite contains metrics for the composite initializer step
974+
InitializerMetric composite = 6;
942975
}
943976

944977
string id = 1;

components/public-api/go/v1/workspace.pb.go

Lines changed: 503 additions & 267 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)