Пример #1
0
        /// <summary>
        /// Returns statistical information collected by the <see cref="Forwarder"/>.
        /// </summary>
        /// <returns>Returns the <see cref="ForwarderStatus"/> object.</returns>
        public ForwarderStatus GetForwarderStatus()
        {
            ForwarderStatus forwarderStatus = new ForwarderStatus();

            forwarderStatus.RelayStatistics = new RelayStatistics();

            forwarderStatus.RelayStatistics.CurrentServerTime  = DateTime.Now;
            forwarderStatus.RelayStatistics.InitializationTime = _initDate;

            TypeSettingStatus tss = TypeSpecificStatisticsManager.Instance.GetStatus(0);

            if (tss == null)           //should not be null
            {
                log.Warn("Fowarder:GetForwarderStatus " +
                         "TypeSettingStatus is null for typeId:0");
                tss = new TypeSettingStatus();                //add empty one to hold place and show error
            }
            forwarderStatus.RelayStatistics.ZeroTypeSettingStatus = tss;

            if (NodeManager.Instance.NodeGroups != null)
            {
                foreach (NodeGroup group in NodeManager.Instance.NodeGroups)
                {
                    forwarderStatus.NodeGroupStatuses.Add(group.GetNodeGroupStatus(NodeManager.Instance.Config.TypeSettings.TypeSettingCollection));
                }
            }
            return(forwarderStatus);
        }
Пример #2
0
        /// <summary>
        /// Returns statistical information collected by the <see cref="Forwarder"/>.
        /// </summary>
        /// <returns>Returns the <see cref="ForwarderStatus"/> object.</returns>
        public ForwarderStatus GetForwarderStatus()
        {
            ForwarderStatus forwarderStatus = new ForwarderStatus();

            forwarderStatus.RelayStatistics = new RelayStatistics();

            forwarderStatus.RelayStatistics.CurrentServerTime  = DateTime.Now;
            forwarderStatus.RelayStatistics.InitializationTime = _initDate;

            if (NodeManager.Instance.NodeGroups != null)
            {
                foreach (NodeGroup group in NodeManager.Instance.NodeGroups)
                {
                    forwarderStatus.NodeGroupStatuses.Add(group.GetNodeGroupStatus(NodeManager.Instance.Config.TypeSettings.TypeSettingCollection));
                }
            }
            return(forwarderStatus);
        }
Пример #3
0
		/// <summary>
		/// Returns statistical information collected by the <see cref="Forwarder"/>.
		/// </summary>
		/// <returns>Returns the <see cref="ForwarderStatus"/> object.</returns>
		public ForwarderStatus GetForwarderStatus()
		{
			ForwarderStatus forwarderStatus = new ForwarderStatus();
			forwarderStatus.RelayStatistics = new RelayStatistics();

			forwarderStatus.RelayStatistics.CurrentServerTime = DateTime.Now;
			forwarderStatus.RelayStatistics.InitializationTime = _initDate;

			if (NodeManager.Instance.NodeGroups != null)
			{
				foreach (NodeGroup group in NodeManager.Instance.NodeGroups)
				{
					forwarderStatus.NodeGroupStatuses.Add(group.GetNodeGroupStatus(NodeManager.Instance.Config.TypeSettings.TypeSettingCollection));
				}
			}
			return forwarderStatus;
		}