protected virtual void Add(Datum value, string name, com.signalfuse.metrics.protobuf.MetricType metricType, MetricTags tags) { IDictionary <string, string> dimensions = ParseTagsToDimensions(tags); DataPoint dataPoint = new DataPoint(); dataPoint.value = value; string metricName = dimensions.ContainsKey(METRIC_DIMENSION) ? dimensions[METRIC_DIMENSION] : name; string sourceName = dimensions.ContainsKey(SOURCE_DIMENSION) ? dimensions[SOURCE_DIMENSION] : defaultSource; dataPoint.metric = metricName; dataPoint.metricType = metricType; if (!String.IsNullOrEmpty(sourceDimension) && !dimensions.ContainsKey(sourceDimension)) { AddDimension(dataPoint, sourceDimension, sourceName); } AddDimensions(dataPoint, defaultDimensions); AddDimensions(dataPoint, dimensions); uploadMessage.datapoints.Add(dataPoint); if (++datapointsAdded >= maxDatapointsPerMessage) { this.sender.Send(uploadMessage); datapointsAdded = 0; this.uploadMessage = new DataPointUploadMessage(); } }
protected virtual void Add(string name, double value, com.signalfuse.metrics.protobuf.MetricType metricType, MetricTags tags) { Datum datum = new Datum(); datum.doubleValue = value; Add(datum, name, metricType, tags); }