Ejemplo n.º 1
0
        public Task SendDataAsync(RequestBag bag)
        {
            if (_RequestBagCollection != null)
            {
                _RequestBagCollection.Flush(bag);
            }

            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        public Task Transport(RequestBag bag)
        {
            _RequestCollection.Flush(new RequestInfoWithDetail {
                Info   = bag.RequestInfo as Collector.Grpc.RequestInfo,
                Detail = bag.RequestDetail as Collector.Grpc.RequestDetail
            });

            return(Task.CompletedTask);
        }
Ejemplo n.º 3
0
        public async Task AddRequestInfoAsync(IRequestInfo request, IRequestDetail detail)
        {
            if (Options.EnableDefer)
            {
                _deferFlushCollection.Flush(request, detail);
            }
            else
            {
                await Client.IndexAsync <RequestInfo>(request as RequestInfo, x => x.Index(GetIndexName <RequestInfo>()));

                await Client.IndexAsync <RequestDetail>(detail as RequestDetail, x => x.Index(GetIndexName <RequestDetail>()));
            }
        }
Ejemplo n.º 4
0
        public async Task AddRequestInfoAsync(RequestBag bag)
        {
            if (_options.EnableDefer)
            {
                _deferFlushCollection.Flush(bag);
            }
            else
            {
                await LoggingSqlOperation(async connection =>
                {
                    await connection.ExecuteAsync($"INSERT INTO [{Prefix}RequestInfo] (Id,ParentId,Node,Route,Url,RequestType,Method,Milliseconds,StatusCode,IP,Port,LocalIP,LocalPort,CreateTime)  VALUES (@Id,@ParentId,@Node, @Route, @Url,@RequestType, @Method, @Milliseconds, @StatusCode, @IP,@Port,@LocalIP,@LocalPort,@CreateTime)", bag.RequestInfo);

                    await connection.ExecuteAsync($"INSERT INTO [{Prefix}RequestDetail] (Id,RequestId,Scheme,QueryString,Header,Cookie,RequestBody,ResponseBody,ErrorMessage,ErrorStack,CreateTime)  VALUES (@Id,@RequestId,@Scheme,@QueryString,@Header,@Cookie,@RequestBody,@ResponseBody,@ErrorMessage,@ErrorStack,@CreateTime)", bag.RequestDetail);
                }, "请求数据保存失败");
            }
        }
Ejemplo n.º 5
0
        public async Task AddRequestInfoAsync(IRequestInfo request, IRequestDetail detail)
        {
            if (Options.EnableDefer)
            {
                _deferFlushCollection.Flush(request, detail);
            }
            else
            {
                await LoggingSqlOperation(async connection =>
                {
                    await connection.ExecuteAsync($"INSERT INTO '{Prefix}RequestInfo' (`Id`,`ParentId`,`Node`, `Route`, `Url`, `RequestType`, `Method`, `Milliseconds`, `StatusCode`, `IP`,`Port`,`LocalIP`,`LocalPort`,`CreateTime`) VALUES (@Id,@ParentId, @Node, @Route, @Url,@RequestType, @Method, @Milliseconds, @StatusCode, @IP,@Port,@LocalIP,@LocalPort, @CreateTime)", request);

                    await connection.ExecuteAsync($"INSERT INTO '{Prefix}RequestDetail' (`Id`,`RequestId`,`Scheme`,`QueryString`,`Header`,`Cookie`,`RequestBody`,`ResponseBody`,`ErrorMessage`,`ErrorStack`,`CreateTime`)  VALUES (@Id,@RequestId,@Scheme,@QueryString,@Header,@Cookie,@RequestBody,@ResponseBody,@ErrorMessage,@ErrorStack,@CreateTime)", detail);
                }, "请求数据保存失败");
            }
        }
Ejemplo n.º 6
0
        public async Task AddRequestInfoAsync(IRequestInfo request, IRequestDetail detail)
        {
            detail = CutRequestDetail(detail);

            if (_options.EnableDefer)
            {
                _deferFlushCollection.Flush(request, detail);
            }
            else
            {
                await LoggingSqlOperation(async _ =>
                {
                    string requestSql = $@"Insert Into RequestInfo  Values (:Id,:ParentId, :Node, :Route, :Url,:RequestType,:Method, :Milliseconds, :StatusCode, :IP,:Port,:LocalIP,:LocalPort,:CreateTime) ";

                    await _.ExecuteAsync(requestSql, request);

                    string detailSql = $@"Insert Into RequestDetail Values  (:Id,:RequestId,:Scheme,:QueryString,:Header,:Cookie,:RequestBody,:ResponseBody,:ErrorMessage,:ErrorStack,:CreateTime)  ";

                    await _.ExecuteAsync(detailSql, detail);
                }, "请求数据保存失败");
            }
        }
Ejemplo n.º 7
0
        public Task Transport(IPerformance performance)
        {
            _PerformanceCollection.Flush(performance);

            return(Task.CompletedTask);
        }
        public Task Write(IRequestInfo requestInfo, IRequestDetail requestDetail)
        {
            _deferFlushCollection.Flush(requestInfo as HttpReports.Collector.Grpc.RequestInfo, requestDetail as HttpReports.Collector.Grpc.RequestDetail);

            return(Task.CompletedTask);
        }
Ejemplo n.º 9
0
        public Task Transport(RequestBag bag)
        {
            _RequestBagCollection.Flush(bag);

            return(Task.CompletedTask);
        }