Esempio n. 1
0
        internal void Publish(Metric metric)
        {
            if (metric.Sample < 1 && metric.Sample < Sampler.NextDouble())
            {
                return;
            }

            var payload = _metricSerializer.SerializeMetric(metric);

            _channel.Write(payload);
        }
Esempio n. 2
0
        public string SerializeMetric(object metric)
        {
            var serializer = new MetricSerializer();

            var serializedMetric = serializer.SerializeMetric((Metric)metric);

            return(serializedMetric);
        }