コード例 #1
0
ファイル: NbtConnection.cs プロジェクト: radtek/GenXSource
        /// <summary>
        /// Returns initialized performance counter according to the specified parameters.
        /// </summary>
        /// <param name="counter">Type of the counter.</param>
        /// <returns>Initialized performance counter.</returns>
        public static PerformanceCounter GetCounter(N counter)
        {
            switch (counter)
            {
            case N.BytesReceivedPerSec:
                return(new PerformanceCounter(
                           "NBT Connection",
                           "Bytes Sent/sec",
                           "Total",
                           true
                           ));

            case N.BytesSentPerSec:
                return(new PerformanceCounter(
                           "NBT Connection",
                           "Bytes Sent/sec",
                           "Total",
                           true
                           ));

            case N.BytesTotalPerSec:
                return(new PerformanceCounter(
                           "NBT Connection",
                           "Bytes Total/sec",
                           "Total",
                           true
                           ));

            default:
                return(null);
            }
        }
コード例 #2
0
		/// <summary>
		/// Returns initialized performance counter according to the specified parameters.
		/// </summary>
		/// <param name="counter">Type of the counter.</param>
		/// <returns>Initialized performance counter.</returns>
		public static PerformanceCounter GetCounter(N counter)
		{
			switch (counter) 
			{
				case N.BytesReceivedPerSec:
					return new PerformanceCounter(
						"NBT Connection",
						"Bytes Sent/sec",
						"Total",
						true
						);
				case N.BytesSentPerSec:
					return new PerformanceCounter(
						"NBT Connection",
						"Bytes Sent/sec",
						"Total",
						true
						);
				case N.BytesTotalPerSec:
					return new PerformanceCounter(
						"NBT Connection",
						"Bytes Total/sec",
						"Total",
						true
						);
				default:
					return null;
			}
		}