Path: blob/main/components/content-service-api/go/wsready.go
2498 views
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package api56import "time"78//go:generate sh generate.sh910// WorkspaceInitSource describes from which source a workspace was initialized11type WorkspaceInitSource string1213const (14// WorkspaceInitFromBackup means the workspace was initialized from one of its previous backups15WorkspaceInitFromBackup WorkspaceInitSource = "from-backup"1617// WorkspaceInitFromPrebuild means the workspace was initialized from a prebuild18WorkspaceInitFromPrebuild WorkspaceInitSource = "from-prebuild"1920// WorkspaceInitFromOther means the workspace was initialized from some other source, e.g. Git21WorkspaceInitFromOther WorkspaceInitSource = "from-other"22)2324// WorkspaceReadyMessage describes the content of a workspace-ready file in a workspace25type WorkspaceReadyMessage struct {26Source WorkspaceInitSource `json:"source"`27Metrics InitializerMetrics `json:"metrics"`28}2930// InitializerStats contains statistics about the initialization31type InitializerMetric struct {32// Type of the initializer33Type string `json:"type"`3435// Duration of the initialization36Duration time.Duration `json:"duration"`3738// Size of the data that was initialized in bytes39Size uint64 `json:"size"`40}4142type InitializerMetrics []InitializerMetric434445