remove existing profiling points

pull/8713/head
Jan Tattermusch 8 years ago
parent 475e06bb12
commit b35dfa83b5
  1. 9
      src/csharp/Grpc.Core/Internal/AsyncCall.cs
  2. 11
      src/csharp/Grpc.Core/Internal/AsyncCallBase.cs
  3. 3
      src/csharp/Grpc.Core/Internal/CallSafeHandle.cs
  4. 3
      src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs
  5. 3
      src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
  6. 3
      src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs

@ -387,8 +387,6 @@ namespace Grpc.Core.Internal
} }
private void Initialize(CompletionQueueSafeHandle cq) private void Initialize(CompletionQueueSafeHandle cq)
{
using (Profilers.ForCurrentThread().NewScope("AsyncCall.Initialize"))
{ {
var call = CreateNativeCall(cq); var call = CreateNativeCall(cq);
@ -396,11 +394,8 @@ namespace Grpc.Core.Internal
InitializeInternal(call); InitializeInternal(call);
RegisterCancellationCallback(); RegisterCancellationCallback();
} }
}
private INativeCall CreateNativeCall(CompletionQueueSafeHandle cq) private INativeCall CreateNativeCall(CompletionQueueSafeHandle cq)
{
using (Profilers.ForCurrentThread().NewScope("AsyncCall.CreateNativeCall"))
{ {
if (injectedNativeCall != null) if (injectedNativeCall != null)
{ {
@ -418,7 +413,6 @@ namespace Grpc.Core.Internal
return result; return result;
} }
} }
}
// Make sure that once cancellationToken for this call is cancelled, Cancel() will be called. // Make sure that once cancellationToken for this call is cancelled, Cancel() will be called.
private void RegisterCancellationCallback() private void RegisterCancellationCallback()
@ -456,8 +450,6 @@ namespace Grpc.Core.Internal
// NOTE: because this event is a result of batch containing GRPC_OP_RECV_STATUS_ON_CLIENT, // NOTE: because this event is a result of batch containing GRPC_OP_RECV_STATUS_ON_CLIENT,
// success will be always set to true. // success will be always set to true.
using (Profilers.ForCurrentThread().NewScope("AsyncCall.HandleUnaryResponse"))
{
TaskCompletionSource<object> delayedStreamingWriteTcs = null; TaskCompletionSource<object> delayedStreamingWriteTcs = null;
TResponse msg = default(TResponse); TResponse msg = default(TResponse);
var deserializeException = TryDeserialize(receivedMessage, out msg); var deserializeException = TryDeserialize(receivedMessage, out msg);
@ -497,7 +489,6 @@ namespace Grpc.Core.Internal
unaryResponseTcs.SetResult(msg); unaryResponseTcs.SetResult(msg);
} }
}
/// <summary> /// <summary>
/// Handles receive status completion for calls with streaming response. /// Handles receive status completion for calls with streaming response.

@ -180,8 +180,6 @@ namespace Grpc.Core.Internal
/// the underlying native resources. /// the underlying native resources.
/// </summary> /// </summary>
protected bool ReleaseResourcesIfPossible() protected bool ReleaseResourcesIfPossible()
{
using (Profilers.ForCurrentThread().NewScope("AsyncCallBase.ReleaseResourcesIfPossible"))
{ {
if (!disposed && call != null) if (!disposed && call != null)
{ {
@ -194,7 +192,6 @@ namespace Grpc.Core.Internal
} }
return false; return false;
} }
}
protected abstract bool IsClient protected abstract bool IsClient
{ {
@ -228,23 +225,16 @@ namespace Grpc.Core.Internal
protected abstract Task CheckSendAllowedOrEarlyResult(); protected abstract Task CheckSendAllowedOrEarlyResult();
protected byte[] UnsafeSerialize(TWrite msg) protected byte[] UnsafeSerialize(TWrite msg)
{
using (Profilers.ForCurrentThread().NewScope("AsyncCallBase.UnsafeSerialize"))
{ {
return serializer(msg); return serializer(msg);
} }
}
protected Exception TryDeserialize(byte[] payload, out TRead msg) protected Exception TryDeserialize(byte[] payload, out TRead msg)
{
using (Profilers.ForCurrentThread().NewScope("AsyncCallBase.TryDeserialize"))
{ {
try try
{ {
msg = deserializer(payload); msg = deserializer(payload);
return null; return null;
} }
catch (Exception e) catch (Exception e)
{ {
@ -252,7 +242,6 @@ namespace Grpc.Core.Internal
return e; return e;
} }
} }
}
/// <summary> /// <summary>
/// Handles send completion (including SendCloseFromClient). /// Handles send completion (including SendCloseFromClient).

@ -75,13 +75,10 @@ namespace Grpc.Core.Internal
} }
public void StartUnary(BatchContextSafeHandle ctx, byte[] payload, MetadataArraySafeHandle metadataArray, WriteFlags writeFlags) public void StartUnary(BatchContextSafeHandle ctx, byte[] payload, MetadataArraySafeHandle metadataArray, WriteFlags writeFlags)
{
using (Profilers.ForCurrentThread().NewScope("CallSafeHandle.StartUnary"))
{ {
Native.grpcsharp_call_start_unary(this, ctx, payload, new UIntPtr((ulong)payload.Length), metadataArray, writeFlags) Native.grpcsharp_call_start_unary(this, ctx, payload, new UIntPtr((ulong)payload.Length), metadataArray, writeFlags)
.CheckOk(); .CheckOk();
} }
}
public void StartClientStreaming(UnaryResponseClientHandler callback, MetadataArraySafeHandle metadataArray) public void StartClientStreaming(UnaryResponseClientHandler callback, MetadataArraySafeHandle metadataArray)
{ {

@ -64,8 +64,6 @@ namespace Grpc.Core.Internal
} }
public CallSafeHandle CreateCall(CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials) public CallSafeHandle CreateCall(CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials)
{
using (Profilers.ForCurrentThread().NewScope("ChannelSafeHandle.CreateCall"))
{ {
var result = Native.grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline); var result = Native.grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);
if (credentials != null) if (credentials != null)
@ -75,7 +73,6 @@ namespace Grpc.Core.Internal
result.Initialize(cq); result.Initialize(cq);
return result; return result;
} }
}
public ChannelState CheckConnectivityState(bool tryToConnect) public ChannelState CheckConnectivityState(bool tryToConnect)
{ {

@ -69,12 +69,9 @@ namespace Grpc.Core.Internal
} }
public CompletionQueueEvent Pluck(IntPtr tag) public CompletionQueueEvent Pluck(IntPtr tag)
{
using (Profilers.ForCurrentThread().NewScope("CompletionQueueSafeHandle.Pluck"))
{ {
return Native.grpcsharp_completion_queue_pluck(this, tag); return Native.grpcsharp_completion_queue_pluck(this, tag);
} }
}
/// <summary> /// <summary>
/// Creates a new usage scope for this completion queue. Once successfully created, /// Creates a new usage scope for this completion queue. Once successfully created,

@ -47,8 +47,6 @@ namespace Grpc.Core.Internal
} }
public static MetadataArraySafeHandle Create(Metadata metadata) public static MetadataArraySafeHandle Create(Metadata metadata)
{
using (Profilers.ForCurrentThread().NewScope("MetadataArraySafeHandle.Create"))
{ {
if (metadata.Count == 0) if (metadata.Count == 0)
{ {
@ -64,7 +62,6 @@ namespace Grpc.Core.Internal
} }
return metadataArray; return metadataArray;
} }
}
/// <summary> /// <summary>
/// Reads metadata from pointer to grpc_metadata_array /// Reads metadata from pointer to grpc_metadata_array

Loading…
Cancel
Save