private void OnRefresh(object sender, EventArgs e) { int i; TrackerList.BeginUpdate(); System.DateTime current = System.DateTime.Now; for (i = 0; i < m_Servers.Length; i++) { System.Windows.Forms.ListViewItem lvi = TrackerList.Items[i]; ServerEntry entry = m_Servers[i]; lvi.SubItems[1].Text = entry.Calls.ToString(); lvi.SubItems[2].Text = (entry.TotalMilliSeconds * 0.001f).ToString("F3"); lvi.SubItems[3].Text = (entry.CallsLastMinute / entry.LastDuration.TotalMinutes).ToString("F0"); lvi.SubItems[4].Text = (entry.MilliSecondsLastMinute / (600 * entry.LastDuration.TotalMinutes)).ToString("F0"); lvi.SubItems[5].Text = entry.Tracks.ToString(); lvi.SubItems[6].Text = (entry.TracksLastMinute / entry.LastDuration.TotalMinutes).ToString("F0"); lvi.SubItems[7].Text = entry.LastError; if ((current - entry.LastStart).TotalSeconds > 60) { entry.CallsLastMinute = entry.CallsThisMinute; entry.CallsThisMinute = 0; entry.MilliSecondsLastMinute = entry.MilliSecondsThisMinute; entry.MilliSecondsThisMinute = 0; entry.TracksLastMinute = entry.TracksThisMinute; entry.TracksThisMinute = 0; entry.LastDuration = current - entry.LastStart; entry.LastStart = current; } } TrackerList.EndUpdate(); }
public void TestList() { TrackerList trackerList = Tracker.List(); Assert.AreNotEqual(0, trackerList.trackers.Count); TrackerList nextTrackerList = trackerList.Next(); Assert.AreNotEqual(trackerList.trackers[0].id, nextTrackerList.trackers[0].id); }
public void TestList() { TrackerList trackerList = Tracker.List(new Dictionary <string, object>() { { "page_size", 1 } }); Assert.AreNotEqual(0, trackerList.trackers.Count); TrackerList nextTrackerList = trackerList.Next(); Assert.AreNotEqual(trackerList.trackers[0].id, nextTrackerList.trackers[0].id); }