Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/content-service-api/go/wsready.go
2498 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package api
6
7
import "time"
8
9
//go:generate sh generate.sh
10
11
// WorkspaceInitSource describes from which source a workspace was initialized
12
type WorkspaceInitSource string
13
14
const (
15
// WorkspaceInitFromBackup means the workspace was initialized from one of its previous backups
16
WorkspaceInitFromBackup WorkspaceInitSource = "from-backup"
17
18
// WorkspaceInitFromPrebuild means the workspace was initialized from a prebuild
19
WorkspaceInitFromPrebuild WorkspaceInitSource = "from-prebuild"
20
21
// WorkspaceInitFromOther means the workspace was initialized from some other source, e.g. Git
22
WorkspaceInitFromOther WorkspaceInitSource = "from-other"
23
)
24
25
// WorkspaceReadyMessage describes the content of a workspace-ready file in a workspace
26
type WorkspaceReadyMessage struct {
27
Source WorkspaceInitSource `json:"source"`
28
Metrics InitializerMetrics `json:"metrics"`
29
}
30
31
// InitializerStats contains statistics about the initialization
32
type InitializerMetric struct {
33
// Type of the initializer
34
Type string `json:"type"`
35
36
// Duration of the initialization
37
Duration time.Duration `json:"duration"`
38
39
// Size of the data that was initialized in bytes
40
Size uint64 `json:"size"`
41
}
42
43
type InitializerMetrics []InitializerMetric
44
45