<commit_before>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using TIKSN.Configuration;

namespace TIKSN.Analytics.Telemetry
{
	public class CompositeEventTelemeter : IEventTelemeter
	{
		private readonly IConfiguration<CommonConfiguration> commonConfiguration;
		private readonly IEnumerable<IEventTelemeter> eventTelemeters;

		public CompositeEventTelemeter(IConfiguration<CommonConfiguration> commonConfiguration, IEnumerable<IEventTelemeter> eventTelemeters)
		{
			this.commonConfiguration = commonConfiguration;
			this.eventTelemeters = eventTelemeters;
		}

		public async Task TrackEvent(string name)
		{
			if (commonConfiguration.GetConfiguration().IsEventTrackingEnabled)
			{
				foreach (var eventTelemeter in eventTelemeters)
				{
					try
					{
						await eventTelemeter.TrackEvent(name);
					}
					catch (Exception ex)
					{
						Debug.WriteLine(ex);<commit_msg>composite event telemeter uses common telemeter options<commit_after>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using TIKSN.Configuration;

namespace TIKSN.Analytics.Telemetry
{
	public class CompositeEventTelemeter : IEventTelemeter
	{
		private readonly IConfiguration<CommonTelemetryOptions> commonConfiguration;
		private readonly IEnumerable<IEventTelemeter> eventTelemeters;

		public CompositeEventTelemeter(IConfiguration<CommonTelemetryOptions> commonConfiguration, IEnumerable<IEventTelemeter> eventTelemeters)
		{
			this.commonConfiguration = commonConfiguration;
			this.eventTelemeters = eventTelemeters;
		}

		public async Task TrackEvent(string name)
		{
			if (commonConfiguration.GetConfiguration().IsEventTrackingEnabled)
			{
				foreach (var eventTelemeter in eventTelemeters)
				{
					try
					{
						await eventTelemeter.TrackEvent(name);
					}
					catch (Exception ex)
					{
						Debug.WriteLine(ex);
{'fraction_non_alphanumeric': 0.06907216494845361, 'fraction_numerical': 0.0, 'mean_word_length': 5.161904761904762, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2272540', 'n_tokens_mistral': 646, 'n_tokens_neox': 539, 'n_words': 109}