From 6d9bed9044f92a09ff28197c965fc9e6ff31ef1d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 1 Jun 2020 22:16:28 +0000 Subject: [PATCH] --- devdocs/tools.txt | 36 ++++++++++++++++++- .../generator/CoreJobMetricsSnapshot.cs | 32 +---------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/devdocs/tools.txt b/devdocs/tools.txt index 7a8032f3..e6775261 100644 --- a/devdocs/tools.txt +++ b/devdocs/tools.txt @@ -694,4 +694,38 @@ JAVASCRIPT DOWNSAMPLING TOOL COlors colours for charts - http://perceptualedge.com/articles/b-eye/choosing_colors.pdf \ No newline at end of file + http://perceptualedge.com/articles/b-eye/choosing_colors.pdf + + + MiniProfiler how to access stats from code + // This is how to access the stored profiler stats if I ever need to + // var profiler = MiniProfiler.StartNew("My Profiler Name"); + // if (profiler != null) + // { + // var Options = profiler.Options; + + // var guids = Options.Storage.List(100); + // // var lastId = context.Request["last-id"]; + // // if (!lastId.IsNullOrWhiteSpace() && Guid.TryParse(lastId, out var lastGuid)) + // // { + // // guids = guids.TakeWhile(g => g != lastGuid); + // // } + + // var ministats = guids.Reverse() + // .Select(g => Options.Storage.Load(g)) + // .Where(p => p != null) + // .Select(p => new + // { + // p.Id, + // p.Name, + // p.ClientTimings, + // p.Started, + // p.HasUserViewed, + // p.MachineName, + // p.User, + // p.DurationMilliseconds + // }).ToList(); + // if(ministats.Count>0){ + // var v=ministats.Count; + // } + // } \ No newline at end of file diff --git a/server/AyaNova/generator/CoreJobMetricsSnapshot.cs b/server/AyaNova/generator/CoreJobMetricsSnapshot.cs index 094fd5bc..ca4aaf64 100644 --- a/server/AyaNova/generator/CoreJobMetricsSnapshot.cs +++ b/server/AyaNova/generator/CoreJobMetricsSnapshot.cs @@ -96,37 +96,7 @@ namespace AyaNova.Biz _lastMMSnapshot = now; - //TEST - var profiler = MiniProfiler.StartNew("My Profiler Name"); - if (profiler != null) - { - var Options = profiler.Options; - - var guids = Options.Storage.List(100); - // var lastId = context.Request["last-id"]; - // if (!lastId.IsNullOrWhiteSpace() && Guid.TryParse(lastId, out var lastGuid)) - // { - // guids = guids.TakeWhile(g => g != lastGuid); - // } - - var ministats = guids.Reverse() - .Select(g => Options.Storage.Load(g)) - .Where(p => p != null) - .Select(p => new - { - p.Id, - p.Name, - p.ClientTimings, - p.Started, - p.HasUserViewed, - p.MachineName, - p.User, - p.DurationMilliseconds - }).ToList(); - if(ministats.Count>0){ - var v=ministats.Count; - } - } + } /////////////////////////////////////////////