Пример #1
0
 // extension method to include EnvironmentTelemetry in TelemetryCollection
 public static void Aggregate(this TelemetryCollection telemetryCollection, EnvironmentTelemetry environmentTelemetry)
 {
     telemetryCollection.Aggregate(
         environmentTelemetry.TraceAggregationCfg,
         string.Empty,
         environmentTelemetry.Metrics,
         environmentTelemetry.Properties,
         DateTime.UtcNow);
 }
Пример #2
0
        // extension method for telemetryCollection to aggregate from EventRecord
        public static void AggregateEventRecord(this TelemetryCollection telemetryCollection, EventRecord eventRecord, EventDefinition eventDefinition, TraceAggregationConfig traceAggregationConfig, string logSourceId)
        {
            // Reading data from eventRecord white-listed fields
            List <KeyValuePair <string, double> > numericalFields;
            List <KeyValuePair <string, string> > stringFields;
            string diffFieldValueString;

            TelemetryUtility.ReadFieldsFromEventRecord(eventRecord, eventDefinition, traceAggregationConfig, out numericalFields, out stringFields, out diffFieldValueString, logSourceId);

            telemetryCollection.Aggregate(traceAggregationConfig, diffFieldValueString, numericalFields, stringFields, DateTime.FromFileTimeUtc(eventRecord.EventHeader.TimeStamp));
        }
Пример #3
0
        public static void Aggregate(this TelemetryCollection telemetryCollection, TelemetryPerformanceInstrumentation telPerfInstrumentation)
        {
            telemetryCollection.Aggregate(
                telPerfInstrumentation.TraceAggregationCfg,
                string.Empty,
                telPerfInstrumentation.Metrics,
                new Dictionary <string, string>(),
                DateTime.UtcNow);

            // the stop watch has to reset everytime the aggregation happens so that the accumulation in sum represents the total time
            // this is necessary so that it supports loading the accumulation from the persisted value.
            telPerfInstrumentation.ProcessingEventsMeasuredTimeReset();
        }