diff --git a/cmd/coordinator/coordinator.go b/cmd/coordinator/coordinator.go index 6a719a52f8..357f36a960 100644 --- a/cmd/coordinator/coordinator.go +++ b/cmd/coordinator/coordinator.go @@ -56,7 +56,6 @@ import ( "golang.org/x/build/autocertcache" "golang.org/x/build/buildenv" "golang.org/x/build/buildlet" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/dashboard" "golang.org/x/build/gerrit" "golang.org/x/build/internal/buildgo" @@ -64,6 +63,7 @@ import ( "golang.org/x/build/internal/secret" "golang.org/x/build/internal/singleflight" "golang.org/x/build/internal/sourcecache" + "golang.org/x/build/internal/spanlog" "golang.org/x/build/livelog" "golang.org/x/build/maintner/maintnerd/apipb" "golang.org/x/build/repos" diff --git a/cmd/coordinator/gce.go b/cmd/coordinator/gce.go index 03592e5a2c..762a4b5c5d 100644 --- a/cmd/coordinator/gce.go +++ b/cmd/coordinator/gce.go @@ -34,13 +34,13 @@ import ( "cloud.google.com/go/storage" "golang.org/x/build/buildenv" "golang.org/x/build/buildlet" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/dashboard" "golang.org/x/build/gerrit" "golang.org/x/build/internal/buildgo" "golang.org/x/build/internal/buildstats" "golang.org/x/build/internal/lru" "golang.org/x/build/internal/secret" + "golang.org/x/build/internal/spanlog" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/compute/v1" diff --git a/cmd/coordinator/sched.go b/cmd/coordinator/sched.go index 314f891282..64e8d389bc 100644 --- a/cmd/coordinator/sched.go +++ b/cmd/coordinator/sched.go @@ -16,9 +16,9 @@ import ( "time" "golang.org/x/build/buildlet" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/dashboard" "golang.org/x/build/internal/buildgo" + "golang.org/x/build/internal/spanlog" "golang.org/x/build/types" ) diff --git a/cmd/coordinator/sched_test.go b/cmd/coordinator/sched_test.go index 263606965a..67ba1dfd38 100644 --- a/cmd/coordinator/sched_test.go +++ b/cmd/coordinator/sched_test.go @@ -15,8 +15,8 @@ import ( "time" "golang.org/x/build/buildlet" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/dashboard" + "golang.org/x/build/internal/spanlog" ) func TestSchedLess(t *testing.T) { diff --git a/cmd/coordinator/spanlog/README.md b/cmd/coordinator/spanlog/README.md deleted file mode 100644 index 80512c88da..0000000000 --- a/cmd/coordinator/spanlog/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -[![GoDoc](https://godoc.org/golang.org/x/build/cmd/coordinator/spanlog?status.svg)](https://godoc.org/golang.org/x/build/cmd/coordinator/spanlog) - -# golang.org/x/build/cmd/coordinator/spanlog - -Package spanlog provides span and event logger interfaces that are used by the build coordinator infrastructure. diff --git a/cmd/coordinator/spanlog/spanlog.go b/cmd/coordinator/spanlog/spanlog.go deleted file mode 100644 index bcf7b3a027..0000000000 --- a/cmd/coordinator/spanlog/spanlog.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package spanlog provides span and event logger interfaces that are used -// by the build coordinator infrastructure. -package spanlog - -// SpanLogger is something that has the CreateSpan method, which -// creates a event spanning some duration which will eventually be -// logged and visualized. -type Logger interface { - // CreateSpan logs the start of an event. - // optText is 0 or 1 strings. - CreateSpan(event string, optText ...string) Span -} - -// Span is a handle that can eventually be closed. -// Typical usage: -// -// sp := sl.CreateSpan("slow_operation") -// result, err := doSlowOperation() -// sp.Done(err) -// // do something with result, err -type Span interface { - // Done marks a span as done. - // The err is returned unmodified for convenience at callsites. - Done(err error) error -} - -// TODO(quentin): Move loggerFunc and createSpan from coordinator.go to here. diff --git a/internal/buildgo/benchmarks.go b/internal/buildgo/benchmarks.go index a14453eb88..ed25472c43 100644 --- a/internal/buildgo/benchmarks.go +++ b/internal/buildgo/benchmarks.go @@ -15,9 +15,9 @@ import ( "golang.org/x/build/buildenv" "golang.org/x/build/buildlet" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/dashboard" "golang.org/x/build/internal/sourcecache" + "golang.org/x/build/internal/spanlog" ) // benchRuns is the number of times to run each benchmark binary diff --git a/internal/buildgo/buildgo.go b/internal/buildgo/buildgo.go index 35c89df75d..3862085f8d 100644 --- a/internal/buildgo/buildgo.go +++ b/internal/buildgo/buildgo.go @@ -20,9 +20,9 @@ import ( "golang.org/x/build/buildenv" "golang.org/x/build/buildlet" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/dashboard" "golang.org/x/build/internal/sourcecache" + "golang.org/x/build/internal/spanlog" ) // BuilderRev is a build configuration type and a revision. diff --git a/internal/sourcecache/source.go b/internal/sourcecache/source.go index 6c79183e8c..933cd8a291 100644 --- a/internal/sourcecache/source.go +++ b/internal/sourcecache/source.go @@ -19,9 +19,9 @@ import ( "net/http" "time" - "golang.org/x/build/cmd/coordinator/spanlog" "golang.org/x/build/internal/lru" "golang.org/x/build/internal/singleflight" + "golang.org/x/build/internal/spanlog" ) var processStartTime = time.Now()