This commit is contained in:
@@ -1,65 +0,0 @@
|
|||||||
// using System;
|
|
||||||
// using System.Threading.Tasks;
|
|
||||||
// using App.Metrics;
|
|
||||||
// using AyaNova.Util;
|
|
||||||
// using System.Linq;
|
|
||||||
|
|
||||||
|
|
||||||
// namespace AyaNova.Biz
|
|
||||||
// {
|
|
||||||
|
|
||||||
|
|
||||||
// /// <summary>
|
|
||||||
// /// called by Generator to flush metrics to reporter
|
|
||||||
// ///
|
|
||||||
// /// </summary>
|
|
||||||
// internal static class CoreJobMetricsReport
|
|
||||||
// {
|
|
||||||
// private static TimeSpan DO_EVERY_INTERVAL = new TimeSpan(0, 0, 20);//FLUSH EVERY 20 SECONDS
|
|
||||||
// private static DateTime lastReportFlushDone = DateTime.MinValue;
|
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// // DoAsync
|
|
||||||
// //
|
|
||||||
// public static async Task DoJobAsync()
|
|
||||||
// {
|
|
||||||
// //https://www.app-metrics.io/
|
|
||||||
// IMetrics metrics = (IMetrics)ServiceProviderProvider.Provider.GetService(typeof(IMetrics));
|
|
||||||
|
|
||||||
// //No more quickly than doeveryinterval
|
|
||||||
// if (!DateUtil.IsAfterDuration(lastReportFlushDone, DO_EVERY_INTERVAL))
|
|
||||||
// return;
|
|
||||||
|
|
||||||
// //RUN ALL REPORTS - FLUSH STATS
|
|
||||||
// var mr = (IMetricsRoot)metrics;
|
|
||||||
// //Task.WaitAll(mr.ReportRunner.RunAllAsync().ToArray());
|
|
||||||
// await Task.WhenAll(mr.ReportRunner.RunAllAsync());
|
|
||||||
|
|
||||||
// lastReportFlushDone = DateTime.UtcNow;
|
|
||||||
|
|
||||||
// //just to hide compiler warning for now
|
|
||||||
// // await Task.CompletedTask;
|
|
||||||
|
|
||||||
|
|
||||||
// // var scheduler = new AppMetricsTaskScheduler(
|
|
||||||
// // TimeSpan.FromSeconds(3),
|
|
||||||
// // async () =>
|
|
||||||
// // {
|
|
||||||
// // await Task.WhenAll(metrics.ReportRunner.RunAllAsync());
|
|
||||||
// // });
|
|
||||||
// // scheduler.Start();
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// }//eoc
|
|
||||||
|
|
||||||
|
|
||||||
// }//eons
|
|
||||||
|
|
||||||
@@ -81,10 +81,15 @@ namespace AyaNova.Biz
|
|||||||
var Gen2 = GC.CollectionCount(2);//integer
|
var Gen2 = GC.CollectionCount(2);//integer
|
||||||
|
|
||||||
//NOTE: CPU percentage is *our* process cpu percentage over timeframe of last captured avg
|
//NOTE: CPU percentage is *our* process cpu percentage over timeframe of last captured avg
|
||||||
//So it does *not* show the entire server cpu load, only for RAVEN, server stats
|
//So it does *not* show the entire server cpu load, only for RAVEN.
|
||||||
//need to be captured / viewed independently (digital ocean control panel for example or windows task manager)
|
//Overall, server stats need to be captured / viewed independently (digital ocean control panel for example or windows task manager)
|
||||||
var CPU = _cpu;// double precision
|
var CPU = _cpu;// double precision
|
||||||
//System.Diagnostics.Debug.WriteLine($"MM Snapshot, cpu: {CPU}");
|
//In some cases the first snapshot taken after a reboot
|
||||||
|
//is a huge number way beyond 100 which fucks up the charts
|
||||||
|
//likely due to the algorithm above and new values but not worth looking into atm
|
||||||
|
if(CPU > 100){
|
||||||
|
CPU=0;
|
||||||
|
}
|
||||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||||
{
|
{
|
||||||
//write to db
|
//write to db
|
||||||
|
|||||||
@@ -1789,5 +1789,18 @@
|
|||||||
"AvailableSpace":"Available space",
|
"AvailableSpace":"Available space",
|
||||||
"OpsTestJob":"Submit test job",
|
"OpsTestJob":"Submit test job",
|
||||||
"Copy":"Copy",
|
"Copy":"Copy",
|
||||||
"ServerProfiler":"Profiler"
|
"ServerProfiler":"Profiler",
|
||||||
|
"MetricFileStorage":"File storage",
|
||||||
|
"MetricAttachmentsMB":"Attachments (MB)",
|
||||||
|
"MetricBackupMB":"Backups (MB)",
|
||||||
|
"MetricAvailableDiskSpace":"Available space (MB)",
|
||||||
|
"MetricAttachmentsCount":"Attachments (count)",
|
||||||
|
"Database":"Database",
|
||||||
|
"MetricDBSize":"Database size (MB)",
|
||||||
|
"MetricTopTablesSize":"Top tables (KB)",
|
||||||
|
"MetricCPUMemory":"CPU / Memory",
|
||||||
|
"MetricAllocatedMemory":"Allocated (MB)",
|
||||||
|
"MetricWorkingSet":"Working set (MB)",
|
||||||
|
"MetricPrivateBytes":"Private bytes (MB)"
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user