Event information record used with mongodb-based reports
Ejemplo n.º 1
0
 public void AddEvent(string seriesId, DateTime? tstamp, IEnumerable<int> values)
 {
     int idx = seriesId.IndexOf('/');
     string sid = seriesId;
     string cname = "mevents";
     if (idx > 0)
     {
         cname = seriesId.Substring(0, idx);
         sid = seriesId.Substring(idx + 1);
     }
     var mev = new MEvent
     {
         Id = KeyGen.GetNextValue(cname),
         P = sid,
         Ts = tstamp.HasValue ? tstamp.Value : DateTime.Now,
         V = new List<int>(values)
     };
     var r = Db.GetCollection(cname).Insert(mev);
 }
Ejemplo n.º 2
0
 public void AddEvent(MEvent mev, string collection)
 {
     Db.GetCollection(collection).Insert(mev);
 }