Commit c1492b6b authored by Hana Kim's avatar Hana Kim Committed by Hyang-Ah Hana Kim

runtime/trace: delete functions replaced by cl/108296

Change-Id: I9bd4e13aafce14f76606b0f96496f621232c9e37
Reviewed-on: https://go-review.googlesource.com/112198Reviewed-by: 's avatarPeter Weinberger <pjw@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e0adc35c
...@@ -24,7 +24,7 @@ type traceContextKey struct{} ...@@ -24,7 +24,7 @@ type traceContextKey struct{}
// If the end function is called multiple times, only the first // If the end function is called multiple times, only the first
// call is used in the latency measurement. // call is used in the latency measurement.
// //
// ctx, task := trace.NewContext(ctx, "awesome task") // ctx, task := trace.NewTask(ctx, "awesome task")
// trace.WithRegion(ctx, prepWork) // trace.WithRegion(ctx, prepWork)
// // preparation of the task // // preparation of the task
// go func() { // continue processing the task in a separate goroutine. // go func() { // continue processing the task in a separate goroutine.
...@@ -58,12 +58,6 @@ func NewTask(pctx context.Context, taskType string) (ctx context.Context, task * ...@@ -58,12 +58,6 @@ func NewTask(pctx context.Context, taskType string) (ctx context.Context, task *
// tracing round. // tracing round.
} }
// NewContext is obsolete by NewTask. Do not use.
func NewContext(pctx context.Context, taskType string) (ctx context.Context, endTask func()) {
ctx, t := NewTask(pctx, taskType)
return ctx, t.End
}
func fromContext(ctx context.Context) *Task { func fromContext(ctx context.Context) *Task {
if s, ok := ctx.Value(traceContextKey{}).(*Task); ok { if s, ok := ctx.Value(traceContextKey{}).(*Task); ok {
return s return s
...@@ -143,11 +137,6 @@ func WithRegion(ctx context.Context, regionType string, fn func()) { ...@@ -143,11 +137,6 @@ func WithRegion(ctx context.Context, regionType string, fn func()) {
fn() fn()
} }
// WithSpan is obsolete by WithRegion. Do not use.
func WithSpan(ctx context.Context, spanType string, fn func(ctx context.Context)) {
WithRegion(ctx, spanType, func() { fn(ctx) })
}
// StartRegion starts a region and returns a function for marking the // StartRegion starts a region and returns a function for marking the
// end of the region. The returned Region's End function must be called // end of the region. The returned Region's End function must be called
// from the same goroutine where the region was started. // from the same goroutine where the region was started.
...@@ -166,12 +155,6 @@ func StartRegion(ctx context.Context, regionType string) *Region { ...@@ -166,12 +155,6 @@ func StartRegion(ctx context.Context, regionType string) *Region {
return &Region{id, regionType} return &Region{id, regionType}
} }
// StartSpan is obsolete by StartRegion. Do not use.
func StartSpan(ctx context.Context, spanType string) func() {
r := StartRegion(ctx, spanType)
return r.End
}
// Region is a region of code whose execution time interval is traced. // Region is a region of code whose execution time interval is traced.
type Region struct { type Region struct {
id uint64 id uint64
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment