/// <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; } }
public IRequestObserver CreateRequestObserver() { return(new MetricsRequestObserver(_metricsManager, _metricsManager.GetSessionMetrics().CqlRequests)); }