This commit is contained in:
@@ -24,20 +24,21 @@ namespace AyaNova.Biz
|
||||
private static double _cpu = 0;
|
||||
|
||||
#if(DEBUG)
|
||||
private static TimeSpan tsOneMinute = new TimeSpan(0, 1, 0);
|
||||
private static TimeSpan tsOneMinute = new TimeSpan(0, 0, 10);
|
||||
private static TimeSpan tsOneHour = new TimeSpan(0, 1, 0);
|
||||
private static TimeSpan ts24Hours = new TimeSpan(0, 1, 0);
|
||||
#else
|
||||
private static TimeSpan tsOneMinute = new TimeSpan(0, 1, 0);
|
||||
#endif
|
||||
private static TimeSpan tsOneHour = new TimeSpan(1, 0, 0);
|
||||
private static TimeSpan ts24Hours = new TimeSpan(24, 0, 0);
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// DoAsync
|
||||
//
|
||||
public static void DoJob()
|
||||
{
|
||||
|
||||
|
||||
|
||||
//Nothing is gathered less than one minute frequency
|
||||
if (!DateUtil.IsAfterDuration(_lastSnapshot, tsOneMinute))
|
||||
return;
|
||||
@@ -143,17 +144,18 @@ namespace AyaNova.Biz
|
||||
if (DateUtil.IsAfterDuration(_lastSnapshot, ts24Hours))
|
||||
{
|
||||
//FILES ON DISK
|
||||
// log.LogTrace("Files on disk information");
|
||||
// var UtilFilesInfo = FileUtil.GetUtilityFolderSizeInfo();
|
||||
// var UserFilesInfo = FileUtil.GetAttachmentFolderSizeInfo();
|
||||
var UtilFilesInfo = FileUtil.GetUtilityFolderSizeInfo();
|
||||
var AttachmentFilesInfo = FileUtil.GetAttachmentFolderSizeInfo();
|
||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||
{
|
||||
//write to db
|
||||
MetricDD dd = new MetricDD(AttachmentFilesInfo.SizeWithChildren, AttachmentFilesInfo.FileCountWithChildren, UtilFilesInfo.SizeWithChildren, UtilFilesInfo.FileCountWithChildren);
|
||||
ct.MetricDD.Add(dd);
|
||||
ct.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
// var mtag = new MetricTags("File type", "Business object files");
|
||||
// metrics.Measure.Gauge.SetValue(MetricsRegistry.FileCountGauge, mtag, UserFilesInfo.FileCountWithChildren);
|
||||
// metrics.Measure.Gauge.SetValue(MetricsRegistry.FileSizeGauge, mtag, UserFilesInfo.SizeWithChildren);
|
||||
|
||||
// mtag = new MetricTags("File type", "OPS files");
|
||||
// metrics.Measure.Gauge.SetValue(MetricsRegistry.FileCountGauge, mtag, UtilFilesInfo.FileCountWithChildren);
|
||||
// metrics.Measure.Gauge.SetValue(MetricsRegistry.FileSizeGauge, mtag, UtilFilesInfo.SizeWithChildren);
|
||||
|
||||
/////////////////////////////////
|
||||
//CLEAR OLD ENTRIES
|
||||
@@ -170,7 +172,6 @@ namespace AyaNova.Biz
|
||||
|
||||
|
||||
_lastSnapshot = now;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +181,5 @@ namespace AyaNova.Biz
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
}//eoc
|
||||
|
||||
|
||||
}//eons
|
||||
|
||||
|
||||
Reference in New Issue
Block a user