Exemplo n.º 1
0
 //Add an event
 public void AddEvent(TrackerEvent e)
 {
     if (_eventQueue.Count < MAX_ELEMS)
     {
         _eventQueue.Enqueue(e);
     }
 }
Exemplo n.º 2
0
        public override void DumpEvent(TrackerEvent e, string path)
        {
            // Open the file if it exits or create a new one
            fs = File.Open(path + _fileName, FileMode.Append);

            bf.Serialize(fs, e);

            // Close the file and release any resources
            fs.Close();
        }
Exemplo n.º 3
0
        public override void DumpEvent(TrackerEvent e, string path)
        {
            StringBuilder sb   = new StringBuilder();
            string        data = string.Format("{0},{1},{2},{3}", e.IdSession, e.Type, e.TimeStamp, e.MoreInfo);

            foreach (char c in data.ToCharArray())
            {
                sb.Append(Convert.ToString(c, 2).PadLeft(8, '0'));
            }
            File.AppendAllText(path + _fileName + ".data", sb.ToString() + "\n");
        }
Exemplo n.º 4
0
 //Force add an event
 public void ForceAddEvent(TrackerEvent e)
 {
     if (_eventQueue.Count < MAX_ELEMS)
     {
         _eventQueue.Enqueue(e);
     }
     else
     {
         TrackerEvent aux;
         _eventQueue.TryDequeue(out aux);
         _eventQueue.Enqueue(e);
     }
 }
Exemplo n.º 5
0
 public override void DumpEvent(TrackerEvent e, string path)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
        public override void DumpEvent(TrackerEvent e, string path)
        {
            string csv = string.Format("{0},{1},{2},{3}\n", e.IdSession, e.Type, e.TimeStamp, e.MoreInfo);

            File.AppendAllText(path + _fileName + ".csv", csv);
        }
Exemplo n.º 7
0
        public override void DumpEvent(TrackerEvent e, string path)
        {
            string result = JsonConvert.SerializeObject(e);

            File.AppendAllText(path + _fileName + ".json", result);
        }
Exemplo n.º 8
0
 //Save an event
 public abstract void DumpEvent(TrackerEvent e, string path);