示例#1
0
 public Stats()
 {
     Requests = new RequestStats();
 }
示例#2
0
 private void StatsTimer_Tick(object sender, EventArgs e)
 {
     RequestStats?.Invoke(this, EventArgs.Empty);
 }
示例#3
0
文件: Server.cs 项目: Tirasa/ConnId
 public void BeginRequest()
 {
     long requestID;
     lock (COUNT_LOCK)
     {
         requestID = _requestCount++;
     }
     Thread requestThread = Thread.CurrentThread;
     RequestStats stats = new RequestStats();
     stats.StartTimeMillis =
         DateTimeUtil.GetCurrentUtcTimeMillis();
     stats.RequestThread = Thread.CurrentThread;
     stats.RequestID = requestID;
     lock (_pendingRequests)
     {
         _pendingRequests[stats.RequestThread]
             = stats;
     }
 }
示例#4
0
文件: Server.cs 项目: Tirasa/ConnId
 private void DumpStats(RequestStats stats,
     StringBuilder builder,
     long currentTime)
 {
     builder.AppendLine("**Request #" + stats.RequestID + " pending for " + (currentTime - stats.StartTimeMillis) + " millis.");
     StackTrace stackTrace = GetStackTrace(stats.RequestThread);
     if (stackTrace == null)
     {
         builder.AppendLine("    <stack trace unavailable>");
     }
     else
     {
         builder.AppendLine(stackTrace.ToString());
     }
 }
示例#5
0
 private void Tick(object source)
 {
     RequestStats?.Invoke(this, EventArgs.Empty);
 }