private void SetCountersValue(MonitorData md)
		{
			PMPerformanceCounters counters = PMPerformanceCounters.GetCounters(md.InstanceName);

			counters.PageAccessCount.Increment();
			counters.PageAccessCountPerSecond.Increment();

			if (md.HasErrors)
				counters.PageErrorCount.Increment();
			else
			{
				counters.PageSuccessCount.Increment();
				counters.PageSuccessRatio.Increment();
			}

			counters.PageSuccessRatioBase.Increment();

			counters.PageAccessCurrentAverageBase.Increment();
			counters.PageAccessCurrentAverage.IncrementBy(md.Stopwatch.ElapsedTicks);
			counters.PageAccessTotalAverageBase.Increment();
			counters.PageAccessTotalAverage.IncrementBy(md.Stopwatch.ElapsedMilliseconds / 100);
		}
        private static void SetOnePFInstanceValues(WebMethodServerCounters instance, MonitorData md, bool hasErrors)
        {
            instance.RequestCount.Increment();

            instance.RequestAverageDurationBase.Increment();
            instance.RequestAverageDuration.IncrementBy(md.Stopwatch.ElapsedMilliseconds / 100);

            if (hasErrors)
                instance.RequestFailCount.Increment();
            else
                instance.RequestSuccessCount.Increment();

            instance.RequestsPerSecond.Increment();
        }
		private void CommitLogging(MonitorData md)
		{
			StringBuilder strB = ((StringWriter)md.LogWriter).GetStringBuilder();

			if (strB.Length > 0)
			{
				try
				{
					Logger logger = LoggerFactory.Create("PageMonitor");

					if (logger != null)
						logger.Write(strB.ToString(), LogPriority.Normal, 8005, TraceEventType.Information, "页面访问日志");
				}
				catch (System.Exception)
				{
				}
			}
		}
        private static void SetCountersValues(MonitorData md, bool hasErrors)
        {
            WebMethodServerCounters global = (WebMethodServerCounters)md.Context["GlobalInstance"];
            WebMethodServerCounters instance = (WebMethodServerCounters)md.Context["Instance"];

            SetOnePFInstanceValues(global, md, hasErrors);
            SetOnePFInstanceValues(instance, md, hasErrors);
        }