@@ -232,6 +232,7 @@ func Run(options ...RunOption) {
232
232
if cfg .DesktopIDE != nil {
233
233
desktopIdeReady = & ideReadyState {cond : sync .NewCond (& sync.Mutex {})}
234
234
}
235
+ go trackReadiness (ctx , gitpodService , cfg , cstate , ideReady , desktopIdeReady )
235
236
tokenService .provider [KindGit ] = []tokenProvider {NewGitTokenProvider (gitpodService , cfg .WorkspaceConfig , notificationService )}
236
237
237
238
go gitpodConfigService .Watch (ctx )
@@ -1554,6 +1555,48 @@ func analyseConfigChanges(ctx context.Context, wscfg *Config, w analytics.Writer
1554
1555
}
1555
1556
}
1556
1557
1558
+ func trackReadiness (ctx context.Context , gitpodService * gitpod.APIoverJSONRPC , cfg * Config , cstate * InMemoryContentState , ideReady * ideReadyState , desktopIdeReady * ideReadyState ) {
1559
+ type SupervisorReadiness struct {
1560
+ Kind string `json:"kind,omitempty"`
1561
+ WorkspaceId string `json:"workspaceId,omitempty"`
1562
+ WorkspaceInstanceId string `json:"instanceId,omitempty"`
1563
+ Timestamp int64 `json:"timestamp,omitempty"`
1564
+ }
1565
+ trackFn := func (ctx context.Context , gitpodService * gitpod.APIoverJSONRPC , cfg * Config , kind string ) {
1566
+ err := gitpodService .TrackEvent (ctx , & gitpod.RemoteTrackMessage {
1567
+ Event : "supervisor_readiness" ,
1568
+ Properties : SupervisorReadiness {
1569
+ Kind : kind ,
1570
+ WorkspaceId : cfg .WorkspaceID ,
1571
+ WorkspaceInstanceId : cfg .WorkspaceInstanceID ,
1572
+ Timestamp : time .Now ().UnixMilli (),
1573
+ },
1574
+ })
1575
+ if err != nil {
1576
+ log .WithError (err ).Error ("error tracking supervisor_readiness" )
1577
+ }
1578
+ }
1579
+ const (
1580
+ readinessKindContent = "content"
1581
+ readinessKindIDE = "ide"
1582
+ readinessKindDesktopIDE = "ide-desktop"
1583
+ )
1584
+ go func () {
1585
+ <- cstate .ContentReady ()
1586
+ trackFn (ctx , gitpodService , cfg , readinessKindContent )
1587
+ }()
1588
+ go func () {
1589
+ <- ideReady .Wait ()
1590
+ trackFn (ctx , gitpodService , cfg , readinessKindIDE )
1591
+ }()
1592
+ if cfg .DesktopIDE != nil {
1593
+ go func () {
1594
+ <- desktopIdeReady .Wait ()
1595
+ trackFn (ctx , gitpodService , cfg , readinessKindDesktopIDE )
1596
+ }()
1597
+ }
1598
+ }
1599
+
1557
1600
func runAsGitpodUser (cmd * exec.Cmd ) * exec.Cmd {
1558
1601
if cmd .SysProcAttr == nil {
1559
1602
cmd .SysProcAttr = & syscall.SysProcAttr {}
0 commit comments