Exemplo n.º 1
0
        public ManualPoint Create(string measurement, DateTime?utcTimestamp = null)
        {
            var tagCollection = new TagCollection();

            _tagReader.Read(tagCollection);
            return(new ManualPoint(_collector, measurement, new FieldCollection(), tagCollection, utcTimestamp));
        }
Exemplo n.º 2
0
        public Task Invoke(MethodProfilingContext profilingContext)
        {
            var profilingFields = new FieldCollection();
            var profilingTags   = new TagCollection();

            _tagReader.Read(profilingTags);
            profilingFields[MethodProfilingConstants.ElapsedMicroseconds] = profilingContext.ElapsedMicroseconds;
            profilingTags[MethodProfilingConstants.ImplementationType]    = profilingContext.ImplementationType;
            profilingTags[MethodProfilingConstants.MethodName]            = profilingContext.MethodName;
            profilingTags[MethodProfilingConstants.Namespace]             = profilingContext.Namespace;
            profilingTags[MethodProfilingConstants.ServiceType]           = profilingContext.ServiceType;
            var point = new Point(profilingContext.ProfilerName, profilingFields, profilingTags);

            return(Task.FromResult(_collector.Push(new Payload(point))));
        }
Exemplo n.º 3
0
        public Task Invoke(RedisProfilingContext profilingContext)
        {
            var points = new List <Point>();

            foreach (var command in profilingContext.ProfilingCommands)
            {
                var redisProfilingFields = new FieldCollection();
                var redisProfilingTags   = new TagCollection();
                _tagReader.Read(redisProfilingTags);
                redisProfilingFields[RedisProfilingConstants.Elapsed]        = command.Elapsed.Milliseconds;
                redisProfilingFields[RedisProfilingConstants.OperationCount] = command.OperationCount.ToString();
                redisProfilingTags[RedisProfilingConstants.ClientName]       = command.ClientName;
                redisProfilingTags[RedisProfilingConstants.Command]          = command.Command;
                redisProfilingTags[RedisProfilingConstants.Db]     = command.Db.ToString();
                redisProfilingTags[RedisProfilingConstants.Server] = command.Server.ToString();
                points.Add(new Point(profilingContext.ProfilerName, redisProfilingFields, redisProfilingTags));
            }
            return(Task.FromResult(_collector.Push(new Payload(points))));
        }
Exemplo n.º 4
0
        public Task Invoke(HttpProfilingContext profilingContext)
        {
            var httpProfilingFields = new FieldCollection();
            var httProfilingTags    = new TagCollection();

            _tagReader.Read(httProfilingTags);
            httpProfilingFields[HttpProfilingConstants.Elapsed]   = profilingContext.Elapsed;
            httProfilingTags[HttpProfilingConstants.HttpHost]     = profilingContext.HttpHost;
            httProfilingTags[HttpProfilingConstants.HttpMethod]   = profilingContext.HttpMethod;
            httProfilingTags[HttpProfilingConstants.HttpPath]     = profilingContext.HttpPath;
            httProfilingTags[HttpProfilingConstants.HttpPort]     = profilingContext.HttpPort;
            httProfilingTags[HttpProfilingConstants.HttpProtocol] = profilingContext.HttpProtocol;
            httProfilingTags[HttpProfilingConstants.HttpScheme]   = profilingContext.HttpScheme;
            httProfilingTags[HttpProfilingConstants.StatusCode]   = profilingContext.StatusCode;
            httProfilingTags[HttpProfilingConstants.IdentityAuthenticationType] = profilingContext.IdentityAuthenticationType;
            httProfilingTags[HttpProfilingConstants.IdentityName]        = profilingContext.IdentityName;
            httProfilingTags[HttpProfilingConstants.RequestContentType]  = profilingContext.RequestContentType;
            httProfilingTags[HttpProfilingConstants.ResponseContentType] = profilingContext.ResponseContentType;
            var point = new Point(profilingContext.ProfilerName, httpProfilingFields, httProfilingTags);

            return(Task.FromResult(_collector.Push(new Payload(new Point[] { point }))));
        }