annotate Stocks/Stocks.Common/Models/SummaryStats.cs @ 15:060f02cd4591

Initial commit, pre airport work
author stevenh7776 stevenhollidge@hotmail.com
date Mon, 12 Mar 2012 23:05:21 +0800
parents e5d46bb6cdb0
children
rev   line source
0
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
1 using System;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
2 using System.Text;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
3
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
4 namespace Stocks.Common.Models
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
5 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
6 public class SummaryStats
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
7 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
8 public WebRequestStats LastWebRequest { get; set; }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
9 public int PriceChangeEvents { get; set; }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
10 public int NumberOfRequests { get; set; }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
11 public DateTime TimeServiceStarted { get; set; }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
12
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
13 public void Reset()
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
14 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
15 LastWebRequest = new WebRequestStats();
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
16 PriceChangeEvents = 0;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
17 NumberOfRequests = 0;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
18 TimeServiceStarted = DateTime.Now;
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
19 }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
20
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
21 public override string ToString()
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
22 {
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
23 var sb = new StringBuilder();
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
24 sb.AppendLine("Stocks Service Summary Stats:");
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
25 sb.AppendLine(string.Format(" Time service started: {0}", TimeServiceStarted));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
26 sb.AppendLine(string.Format(" Number of requests: {0}", NumberOfRequests));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
27 sb.AppendLine(string.Format(" Number of price change events: {0}", PriceChangeEvents));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
28 sb.AppendLine(string.Format(" Number of symbols sent on last request: {0}", LastWebRequest.SymbolCount));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
29 sb.AppendLine(string.Format(" Number of prices in last response: {0}", LastWebRequest.PricesDownloaded));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
30 sb.AppendLine(string.Format(" Time taken for last request: {0}", LastWebRequest.Duration));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
31 //sb.AppendLine(string.Format(" Response string for last request: {0}", LastWebRequest.Response));
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
32 return sb.ToString();
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
33 }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
34 }
e5d46bb6cdb0 Initial commit
adminSH stevenhollidge@hotmail.com
parents:
diff changeset
35 }