code: function getRepeatText(run, events, index) {
      var event = run.eventsById[events[index]];
      var result = 1;
      var i = index - 1;
      while (i >= 0) {
          var previous = run.eventsById[events[i]];
          if (previous.name === event.name && previous.type === event.type) {
              result++;
              i--;
          }
          else {
              return result === 1 ? "" : " (x" + result + ")";
          }
      }
      return result === 1 ? "" : " (x" + result + ")";
  }
docs: # Helpers