mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-02-05 07:23:59 +00:00
StatsManager: added ReloadStats() method.
This commit is contained in:
@@ -466,10 +466,26 @@ namespace DnsServerCore.Dns
|
||||
}
|
||||
}
|
||||
|
||||
private void Flush()
|
||||
{
|
||||
//clear in memory stats
|
||||
for (int i = 0; i < _lastHourStatCountersCopy.Length; i++)
|
||||
_lastHourStatCountersCopy[i] = null;
|
||||
|
||||
_hourlyStatsCache.Clear();
|
||||
_dailyStatsCache.Clear();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public
|
||||
|
||||
public void ReloadStats()
|
||||
{
|
||||
Flush();
|
||||
LoadLastHourStats();
|
||||
}
|
||||
|
||||
public void DeleteAllStats()
|
||||
{
|
||||
foreach (string hourlyStatsFile in Directory.GetFiles(Path.Combine(_dnsServer.ConfigFolder, "stats"), "*.stat", SearchOption.TopDirectoryOnly))
|
||||
@@ -482,11 +498,7 @@ namespace DnsServerCore.Dns
|
||||
File.Delete(dailyStatsFile);
|
||||
}
|
||||
|
||||
for (int i = 0; i < _lastHourStatCountersCopy.Length; i++)
|
||||
_lastHourStatCountersCopy[i] = null;
|
||||
|
||||
_hourlyStatsCache.Clear();
|
||||
_dailyStatsCache.Clear();
|
||||
Flush();
|
||||
}
|
||||
|
||||
public void Update(DnsDatagram response, IPAddress clientIpAddress)
|
||||
|
||||
Reference in New Issue
Block a user