<commit_before>class KinesisPublisher
  def self.publish(event_type, partition_key, data, linked = {})
    return unless client

    client.put_record(
      stream_name: stream_name,
      partition_key: partition_key.to_s,
      data: format_data(event_type, data, linked)
    )
  rescue StandardError => ex
    # While we're still evaluating Kinesis, don't propagate this error, but do notify Honeybadger.
    Honeybadger.notify(ex)
  end

  def self.format_data(event_type, data, linked)
    {
      source: 'panoptes',
      type: event_type,
      version: '1.0.0',
      data: data,
      linked: linked
    }.to_json
  end

  def self.client
    @client
  end
<commit_msg>Add timestamp<commit_after>class KinesisPublisher
  def self.publish(event_type, partition_key, data, linked = {})
    return unless client

    client.put_record(
      stream_name: stream_name,
      partition_key: partition_key.to_s,
      data: format_data(event_type, data, linked)
    )
  rescue StandardError => ex
    # While we're still evaluating Kinesis, don't propagate this error, but do notify Honeybadger.
    Honeybadger.notify(ex)
  end

  def self.format_data(event_type, data, linked)
    {
      source: 'panoptes',
      type: event_type,
      version: '1.0.0',
      timestamp: Time.now.utc.iso8601,
      data: data,
      linked: linked
    }.to_json
  end

  def self.client
    @client
  end

{'fraction_non_alphanumeric': 0.09077912794853467, 'fraction_numerical': 0.007147962830593281, 'mean_word_length': 2.9660056657223794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4705312', 'n_tokens_mistral': 475, 'n_tokens_neox': 452, 'n_words': 117}