Ejemplo n.º 1
0
        private Tuple <int, int> GetStatistics(string functionId)
        {
            if (_cachedStatistics.ContainsKey(functionId))
            {
                return(_cachedStatistics[functionId]);
            }

            FunctionStatistics entity = _statisticsReader.Lookup(functionId);
            int succeededCount;
            int failedCount;

            if (entity == null)
            {
                succeededCount = 0;
                failedCount    = 0;
            }
            else
            {
                succeededCount = entity.SucceededCount;
                failedCount    = entity.FailedCount;
            }

            Tuple <int, int> results = new Tuple <int, int>(succeededCount, failedCount);

            _cachedStatistics.AddOrUpdate(functionId, (_) => results, (ignore1, ignore2) => results);
            return(results);
        }