BrakePedal.MemoryThrottleRepository.CreateThrottleKey C# (CSharp) Метод

CreateThrottleKey() публичный Метод

public CreateThrottleKey ( IThrottleKey key, BrakePedal.Limiter limiter ) : string
key IThrottleKey
limiter BrakePedal.Limiter
Результат string
        public string CreateThrottleKey(IThrottleKey key, Limiter limiter)
        {
            List<object> values = CreateBaseKeyValues(key, limiter);

            string countKey = TimeSpanToFriendlyString(limiter.Period);
            values.Add(countKey);

            // Using the Unix timestamp to the key allows for better
            // precision when querying a key from Redis
            if (limiter.Period.TotalSeconds == 1)
                values.Add(GetUnixTimestamp());

            string id = string.Join(":", values);
            return id;
        }