using Sony.Filtr.AppleMusic.Models; using Sony.Filtr.Utility.Extensions; using System; using System.Diagnostics.Tracing; namespace Sony.Filtr.Tasks.EventSource { public class ApolloFetchAppleMusicChartsEventSource : System.Diagnostics.Tracing.EventSource { public static readonly ApolloFetchAppleMusicChartsEventSource Log = new ApolloFetchAppleMusicChartsEventSource(); private ApolloFetchAppleMusicChartsEventSource() { } internal void ProcessStart(int storeFrontCount) { this.WriteEvent(1, storeFrontCount); } internal void ProcessStop(double duration) { this.WriteEvent(2, duration); } [NonEvent] internal void ProcessException(Exception ex) { this.ProcessException(ex.GetType().Name, ex.GetFullMessage()); } private void ProcessException(string exceptionType, string message) { this.WriteEvent(3, exceptionType, message); } internal void SaveCurrentChartSongTopListStart(int storeFrontsCount, int chartsCount) { this.WriteEvent(4, storeFrontsCount, chartsCount); } internal void SaveCurrentChartSongTopListStop(double duration) { this.WriteEvent(5, duration); } [NonEvent] internal void SaveCurrentMostPlayedSongChartException(Exception ex) { this.SaveCurrentMostPlayedSongChartException(ex.GetType().Name, ex.GetFullMessage()); } private void SaveCurrentMostPlayedSongChartException(string exceptionType, string message) { this.WriteEvent(6, exceptionType, message); } internal void SaveCurrentMostPlayedSongChartStart(string storefrontId) { this.WriteEvent(7, storefrontId); } internal void SaveCurrentMostPlayedSongChartStop(double duration) { this.WriteEvent(8, duration); } internal void SavedAppleMusicSongChart(string storefrontId, int mostPlayedSongChartCount) { this.WriteEvent(9, storefrontId, mostPlayedSongChartCount); } internal void RequestedAppleMusicSongChart(string storefrontId, int mostPlayedSongChartCount) { this.WriteEvent(10, storefrontId, mostPlayedSongChartCount); } internal void FetchChartsStart(int storeFrontsCount) { this.WriteEvent(11, storeFrontsCount); } internal void FetchChartsStop(double duration) { this.WriteEvent(12, duration); } internal void GetFullChartFromAppleMusicStart(string storefrontId) { this.WriteEvent(13, storefrontId); } internal void GetFullChartFromAppleMusicStop(string storefrontId) { this.WriteEvent(14, storefrontId); } [NonEvent] internal void SaveChartStart(string storefrontId, long? genreId, int albumsCount, int musicVideosCount, int playlistCount, int songsCount) { this.SaveChartStart(storefrontId, genreId.HasValue ? genreId.Value : 0, albumsCount, musicVideosCount, playlistCount, songsCount); } private void SaveChartStart(string storefrontId, long genreId, int albumsCount, int musicVideosCount, int playlistCount, int songsCount) { this.WriteEvent(15, storefrontId, genreId, albumsCount, musicVideosCount, playlistCount, songsCount); } internal void SaveChartStop(string storefrontId) { this.WriteEvent(16, storefrontId); } internal void SavedStoreFrontChartGenres(string storefrontId, int genresCount) { this.WriteEvent(17, storefrontId, genresCount); } [NonEvent] internal void SaveChartException(string storefrontId, GenreData chartGenre, Exception ex) { SaveChartException(storefrontId, chartGenre.id, ex.GetType().Name, ex.GetFullMessage()); } private void SaveChartException(string storefrontId, long genreId, string exceptionName, string message) { this.WriteEvent(18, storefrontId, genreId, exceptionName, message); } public void NoMostPlayedChart(string storefrontId) { this.WriteEvent(19, storefrontId); } } }