function countEventTypes()

in src/shippers/elastic_v3/common/src/report_telemetry_counters.ts [50:62]


function countEventTypes(events: Event[]) {
  return events.reduce(
    (acc, event) => {
      if (acc[event.event_type]) {
        acc[event.event_type] += 1;
      } else {
        acc[event.event_type] = 1;
      }
      return acc;
    },
    {} as Record<string, number>
  );
}