Sha256: 15327b0c0f04236aa97164c743605e08748e3a88294f54803f60aa376cb42e93

Contents?: true

Size: 945 Bytes

Versions: 8

Compression:

Stored size: 945 Bytes

Contents

# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/agent/telemetry/input_analysis_event'

module Contrast
  module Agent
    module Telemetry
      # Event to report all gather information from the Input Analysis Cache statistics, hits and misses.
      class InputAnalysisCacheEvent < Contrast::Agent::Telemetry::InputAnalysisEvent
        NAME = 'InputAnalysis cache event'
        PATH = '/protect_input_analysis_cache'

        private

        # Creates the tags for the event
        #
        # @param rule_id [String]
        # @param match_rates [Contrast::Agent::Protect::Rule::InputClassification::MatchRates]
        def add_tags rule_id, match_rates
          super(rule_id, match_rates)
          @tags['score_level'] = match_rates&.score_level.dup&.to_s || NOT_APPLICABLE
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.6.0 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.5.0 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.4.1 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.4.0 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.3.2 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.3.1 lib/contrast/agent/telemetry/input_analysis_cache_event.rb
contrast-agent-7.3.0 lib/contrast/agent/telemetry/input_analysis_cache_event.rb