public void RecordRpcStats()
        {
            var gameletData = new DeveloperLogEvent.Types.GameletData
            {
                Type = DeveloperLogEvent.Types.GameletData.Types.Type.GameletEdge
            };
            var rpcAction = actionRecorder.CreateToolAction(MetricActionType);

            rpcAction.Record(delegate {
                rpcAction.UpdateEvent(new DeveloperLogEvent {
                    GameletData = gameletData
                });
                (rpcAction as RpcRecorder).Record(FakeMethod, Status.DefaultSuccess, 1000);
            });

            var expectedRpcDetails = new GrpcServiceCallDetails
            {
                ServiceName      = FakeServiceName,
                ServiceMethod    = FakeMethodName,
                Status           = new Status(StatusCode.OK, null),
                RoundtripLatency = 1000 * 1000  // 1000ms in us
            };

            if (logEvent.GrpcCallDetails == null)
            {
                logEvent.GrpcCallDetails = new List <GrpcServiceCallDetails>();
            }

            logEvent.GrpcCallDetails.Add(expectedRpcDetails);
            logEvent.GameletData = gameletData;
            metrics.Received(1).RecordEvent(EventType, logEvent);
            AssertTimerUsedCorrectly();
        }
        public async Task RecordAsyncSuccessAsync()
        {
            var gameletData = new DeveloperLogEvent.Types.GameletData
            {
                Type = DeveloperLogEvent.Types.GameletData.Types.Type.GameletEdge
            };
            var action = actionRecorder.CreateToolAction(MetricActionType);
            await action.RecordAsync(Task.Run(() =>
            {
                action.UpdateEvent(new DeveloperLogEvent {
                    GameletData = gameletData
                });
                action.Record(FakeMethod, Status.DefaultSuccess, 1000);
            }));

            var expectedRpcDetails = new GrpcServiceCallDetails
            {
                ServiceName      = FakeServiceName,
                ServiceMethod    = FakeMethodName,
                Status           = new Status(StatusCode.OK, null),
                RoundtripLatency = 1000 * 1000  // 1000ms in us
            };

            logEvent.GrpcCallDetails.Add(expectedRpcDetails);
            logEvent.GameletData = gameletData;
            metrics.Received(1).RecordEvent(EventType, logEvent);

            AssertTimerUsedCorrectly();
        }