예제 #1
0
        /// <summary>
        /// Increments session client timeout counter in case of timeout.
        /// </summary>
        public static void WaitToCompleteWithMetrics(IMetricsManager manager, Task task, int timeout = Timeout.Infinite)
        {
            if (!(manager?.AreMetricsEnabled ?? false))
            {
                TaskHelper.WaitToComplete(task, timeout);
                return;
            }

            try
            {
                TaskHelper.WaitToComplete(task, timeout);
            }
            catch (TimeoutException)
            {
                manager.GetSessionMetrics().CqlClientTimeouts.Increment();
                throw;
            }
        }
예제 #2
0
 public IRequestObserver CreateRequestObserver()
 {
     return(new MetricsRequestObserver(_metricsManager, _metricsManager.GetSessionMetrics().CqlRequests));
 }