/// <summary> /// This method is called on a regular interval when the statistics are updated. /// </summary> /// <param name="statistics">The statistics collection.</param> internal virtual void OnStatisticsIssued(Microservice.Statistics statistics) { try { StatisticsIssued?.Invoke(mService, new StatisticsEventArgs() { Statistics = statistics }); } catch (Exception ex) { mDataCollection?.LogException("StatisticsIssued event / external exception thrown on event", ex); } }
/// <summary> /// This method sets the updated Microservice statistics. /// </summary> protected override void StatisticsRecalculate(Microservice.Statistics stats) { stats.Id = Id; stats.Name = Id.Name; stats.Created = Id.StartTime; stats.Status = Status.ToString(); stats.LogTime = DateTime.UtcNow; stats.Tasks = mTaskManager?.StatisticsRecalculated; stats.DataCollection = mDataCollection?.StatisticsRecalculated; stats.Communication = mCommunication?.StatisticsRecalculated; stats.Resources = mResourceMonitor?.StatisticsRecalculated; stats.Commands = mCommands?.StatisticsRecalculated; stats.Scheduler = mScheduler?.StatisticsRecalculated; stats.ServiceHandlers = mServiceHandlers?.StatisticsRecalculated; }