incStatsByNewEvent method

void incStatsByNewEvent(
  1. Nip01Event event,
  2. int bytes
)

increment stats by new event

Implementation

void incStatsByNewEvent(Nip01Event event, int bytes) {
  int eventsRead = stats.eventsRead[event.kind] ?? 0;
  stats.eventsRead[event.kind] = eventsRead + 1;
  int bytesRead = stats.dataReadBytes[event.kind] ?? 0;
  stats.dataReadBytes[event.kind] = bytesRead + bytes;
}