protected static Dictionary <string, Serie <string, BasicEntry> > CreateRows(DateTime startTime, int count) { var series = new Dictionary <string, Serie <string, BasicEntry> >(); DateTime current = startTime; for (int i = 0; i < count; i++) { var id = Ids[_rng.Next(Ids.Length)]; Serie <string, BasicEntry> serie; if (!series.TryGetValue(id, out serie)) { serie = new Serie <string, BasicEntry>(id); series.Add(id, serie); } var entry = new BasicEntry(); entry.Timestamp = current; entry.Value = _rng.NextDouble(); current = current.AddSeconds(1); serie.Entries.Add(entry); } return(series); }
protected static Serie <string, BasicEntry> CreateByteArrayRows(string id, DateTime startTime, byte[] arr, int count) { var serie = new Serie <string, BasicEntry>(id); DateTime current = startTime; for (int i = 0; i < count; i++) { var entry = new BasicEntry(); entry.Timestamp = current; entry.Fields["Data"] = arr; current = current.AddSeconds(1); serie.Entries.Add(entry); } return(serie); }
protected static Serie <string, BasicEntry> CreateRows(string id, DateTime startTime, int count) { var serie = new Serie <string, BasicEntry>(id); DateTime current = startTime; for (int i = 0; i < count; i++) { var entry = new BasicEntry(); entry.Timestamp = current; entry.Value = _rng.NextDouble(); current = current.AddSeconds(1); serie.Entries.Add(entry); } return(serie); }
public Serie <BasicKey, BasicEntry> GetEntries(DateTime now) { var serie = new Serie <BasicKey, BasicEntry>(Id); for (var timestamp = _currentTimestamp; timestamp < now; timestamp += Interval) { var entry = new BasicEntry(); entry.Timestamp = timestamp; _velocity = _rng.NextDouble() - 0.5; _currentValue += _velocity; entry.Value = _currentValue; serie.Entries.Add(entry); } _currentTimestamp = now; return(serie); }
private string Link(BasicEntry entry) { return($"<https://fantasy.premierleague.com/entry/{entry.Id}/event/{entry.CurrentEvent}|{entry.TeamName}>"); }