-// Copyright 2017 gRPC authors.
+// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// See the License for the specific language governing permissions and
// limitations under the License.
-syntax = "proto3";
+// +build go1.9
-package grpc.health.v1;
+package tag
-message HealthCheckRequest {
- string service = 1;
-}
+import (
+ "context"
+ "runtime/pprof"
+)
-message HealthCheckResponse {
- enum ServingStatus {
- UNKNOWN = 0;
- SERVING = 1;
- NOT_SERVING = 2;
- }
- ServingStatus status = 1;
+func do(ctx context.Context, f func(ctx context.Context)) {
+ m := FromContext(ctx)
+ keyvals := make([]string, 0, 2*len(m.m))
+ for k, v := range m.m {
+ keyvals = append(keyvals, k.Name(), v)
+ }
+ pprof.Do(ctx, pprof.Labels(keyvals...), f)
}
-
-service Health{
- rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
-}