Skip to content

Commit 1330c82

Browse files
committed
[api] Expose session.Metrics.InitializerMetrics
Tool: gitpod/catfood.gitpod.cloud
1 parent ef09c04 commit 1330c82

File tree

7 files changed

+4131
-453
lines changed

7 files changed

+4131
-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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,48 @@ 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 seconds
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+
// This is set whenever a `git clone` is issued (mostly on first workspace start)
959+
InitializerMetric git = 1;
960+
961+
// file_download contains metrics for the file download initializer step
962+
// This is set for injecting "additionalFiles" into the workspace.
963+
InitializerMetric file_download = 2;
964+
965+
// snapshot contains metrics for the snapshot initializer step
966+
// This used for workspaces started from snapshots.
967+
InitializerMetric snapshot = 3;
968+
969+
// backup contains metrics for the backup initializer step
970+
// This is set on subsequent workspace starts, when the file system is restored from backup.
971+
InitializerMetric backup = 4;
972+
973+
// prebuild contains metrics for the prebuild initializer step
974+
// This is set if the workspace is based on a prebuild.
975+
InitializerMetric prebuild = 5;
976+
977+
// composite contains metrics for the composite initializer step
978+
// This reports the total if multiple steps are run to initialize the workspace content.
979+
// Examples are:
980+
// - "additionalFiles" injected into the workspace
981+
// - "additionalRepositories" configured
982+
// - incremental Prebuilds
983+
InitializerMetric composite = 6;
942984
}
943985

944986
string id = 1;

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

Lines changed: 512 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)