示例#1
0
        private static async void GetAllExceptions(AiCloudBlobReader blobReader, string containerFolder)
        {
            var parser = new AppInsightsItemParser();
            var blobs  = await blobReader.GetBlobInfosFromFolderAndSubFoldersAsync($"{containerFolder}/Exceptions"); // Careful! All logs will be parsed!

            var everyLine = blobs.SelectMany(blobReader.ToStringsForEveryLine).ToList();
            var items     = parser.ParseExceptionItems(everyLine).ToList();

            PrintBlobInfo(items);
        }
示例#2
0
        private static async void GetTracesForLastDay(AiCloudBlobReader blobReader)
        {
            var parser          = new AppInsightsItemParser();
            var latestTraceBlob = await blobReader.GetLatestBlobInfoAsync("Messages");

            var blobs = await blobReader.GetBlobInfosFromFolderAndSubFoldersAsync(latestTraceBlob.FolderDay); // For the entire day

            var everyLine = blobs.SelectMany(blobReader.ToStringsForEveryLine).ToList();
            var traces    = parser.ParseTraceItems(everyLine).ToList();

            PrintBlobInfo(traces);

            var first = traces.OrderBy(p => p.TimeStampUtc).First().TimeStampUtc.ToString("yyyy-MM-dd HH:mm:ss");
            var last  = traces.OrderBy(p => p.TimeStampUtc).Last().TimeStampUtc.ToString("yyyy-MM-dd HH:mm:ss");

            Console.WriteLine($"Blobs: {blobs.Count}, Traces: {traces.Count}, Earliest-Utc: {first}, Latest-Utc: {last}");
        }