private void DoStackExchangeHealth(HealthCheckResult health)
        {
            var commandFlagsEnum = RedisTypeLocator.StackExchangeCommandFlagsNames;
            var none             = Enum.Parse(commandFlagsEnum, "None");
            var connector        = _factory.Create(null);

            var getDatabaseMethod = ConnectorHelpers.FindMethod(connector.GetType(), "GetDatabase");
            var db         = ConnectorHelpers.Invoke(getDatabaseMethod, connector, new object[] { -1, null });
            var pingMethod = ConnectorHelpers.FindMethod(db.GetType(), "Ping");
            var latency    = (TimeSpan)ConnectorHelpers.Invoke(pingMethod, db, new[] { none });

            health.Details.Add("ping", latency.TotalMilliseconds);
        }
        private void Connect()
        {
            if (_connector == null)
            {
                _connector = _factory.Create(null);
                if (_connector == null)
                {
                    throw new ConnectorException("Unable to connect to Redis");
                }

                if (IsMicrosoftImplementation)
                {
                    _getMethod = _connector.GetType().GetMethod("Get");
                }
                else
                {
                    var commandFlagsEnum = RedisTypeLocator.StackExchangeCommandFlagsNames;
                    _flags = Enum.Parse(commandFlagsEnum, "None");
                    var getDatabaseMethod = ReflectionHelpers.FindMethod(_connector.GetType(), "GetDatabase");
                    _database   = ReflectionHelpers.Invoke(getDatabaseMethod, _connector, new object[] { -1, null });
                    _pingMethod = ReflectionHelpers.FindMethod(_database.GetType(), "Ping");
                }
            }
        }