예제 #1
0
        public void Add(RawLog raw, Sample sample)
        {
            var msg        = _strCache.Cache(raw.Message);
            var stacktrace = _strCache.Cache(raw.Stacktrace);
            var newLog     = new Log(raw.Type, msg, stacktrace, sample);

            _logs.Add(newLog);
            Organizer.Internal_AddToCache(newLog);
        }
예제 #2
0
        private void OnSubscribe(string message, string stacktrace, LogType type)
        {
            var log = new RawLog(type, message, stacktrace);

            lock (_queue)
            {
                _isQueueEmpty = false;
                _queue.Add(log);
            }
        }
예제 #3
0
        private void AddToCache_Collapsed(Log log)
        {
            if (!_lastCollapsedMask.Check(log.Type))
            {
                return;
            }
            var rawLog = new RawLog(log.Type, log.Message, log.Stacktrace);
            var hash   = rawLog.GetHashCode();
            int index;

            if (_lastCollapsedIndex.TryGetValue(hash, out index))
            {
                var logAndCount = _lastCollapsedLogs[index];
                logAndCount.Inc();
                _lastCollapsedLogs[index] = logAndCount;
            }
            else
            {
                _lastCollapsedIndex.Add(hash, _lastCollapsedLogs.Count);
                _lastCollapsedLogs.Add(new LogAndCount(rawLog));
            }
        }
예제 #4
0
 public LogAndCount(RawLog log)
 {
     Log   = log;
     Count = 1;
 }