Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
Bug 1588789 - log workerReady the first time we're ready to call queu…
Browse files Browse the repository at this point in the history
…e.claimWork
  • Loading branch information
petemoore committed Oct 15, 2019
1 parent 2e60675 commit 63ffdb4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ var (
reclaimEvery5Seconds = false
// Current working directory of process
cwd = CwdOrPanic()
// workerReady becomes true when it is able to call queue.claimWork for the first time
workerReady = false
// Whether we are running under the aws provisioner
configureForAWS bool
// Whether we are running in GCP
Expand Down Expand Up @@ -390,7 +392,6 @@ func RunWorker() (exitCode ExitCode) {
if host, err := sysinfo.Host(); err == nil {
logEvent("instanceBoot", nil, host.Info().BootTime)
}
logEvent("workerReady", nil, time.Now())

err = setupExposer()
if err != nil {
Expand Down Expand Up @@ -541,6 +542,11 @@ func RunWorker() (exitCode ExitCode) {

// ClaimWork queries the Queue to find a task.
func ClaimWork() *TaskRun {
// only log workerReady the first time queue.claimWork is called
if !workerReady {
workerReady = true
logEvent("workerReady", nil, time.Now())
}
req := &tcqueue.ClaimWorkRequest{
Tasks: 1,
WorkerGroup: config.WorkerGroup,
Expand Down
14 changes: 14 additions & 0 deletions uptime/update_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"log"
"syscall"
)

func main() {
uptime, err := syscall.Sysctl("kern.boottime")
if err != nil {
log.Fatalf("%v", err)
}
log.Printf("Uptime: %v", uptime)
}
Binary file added worker_types/gwci-linux/screenshot.xwd
Binary file not shown.

0 comments on commit 63ffdb4

Please sign in to comment.