Exemplo n.º 1
0
        public Task InvokeAsync(HttpContext context)
        {
            var item = context.Request.Path;
            var ip   = context.Request.HttpContext.Connection.RemoteIpAddress;

            _logger.LogInformation($"RemoteIpAddress: {ip}");
            if (!item.Value.Contains("Stat"))
            {
                var measure = new Measure(item, new Occurence(DateTime.Now, context.Request.Method));
                _statsService.AddMeasure(item, measure);
            }
            return(_next(context));
        }