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); }
private void OnSubscribe(string message, string stacktrace, LogType type) { var log = new RawLog(type, message, stacktrace); lock (_queue) { _isQueueEmpty = false; _queue.Add(log); } }
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)); } }
public LogAndCount(RawLog log) { Log = log; Count = 1; }