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); }
private Listener(string address, string functionName, Type ServiceType, Logger logger) { _address = address; _Listener = new HttpListener(); _Listener.Prefixes.Add(address); _FunctionName = functionName; _Runner = SimpleFuncRunner.Create(ServiceType); _Logger = logger; _Statistics = new FunctionStatistics(); _FunctionSettings = new Settings(); }