public async Task Run([TimerTrigger("0 */30 * * * *")] TimerInfo myTimer) { _logger.Information("Executing function {Function} at {DateTimeUtc}", FunctionName, DateTime.UtcNow); await _dnsServerStatisticsIngresser.IngressDnsServerStatistics(); // Fetch & store statistics from all servers (legacy only) var summarizedStatisticsPerServer = await _statisticsSummarizer.SummarizeTimeSpan(TimeSpan.FromHours(HoursToSummarize)); // Summarize statistics for past 24h for all servers await _statisticsSender.SendSummarizedStatistics(summarizedStatisticsPerServer); // Send summarized statistics to Wordpress website }
public async Task Run([TimerTrigger("0 0 */12 * * *")] TimerInfo myTimer) { var summarizedStatisticsPerServer = await _statisticsSummarizer.SummarizeTimeSpan(TimeSpan.FromDays(30)); foreach (var statistic in summarizedStatisticsPerServer) { statistic.ServerName = $"{statistic.ServerName}-30d"; } await _statisticsSender.SendSummarizedStatistics(summarizedStatisticsPerServer); // Send summarized statistics to Wordpress website }