Sha256: e7474a7f241d0ed08d49bb8e65e5305f5c7d712085dd3e88b9c6a6b53c059521
Contents?: true
Size: 1.9 KB
Versions: 17
Compression:
Stored size: 1.9 KB
Contents
# frozen_string_literal: true [ File.join(File.dirname(__FILE__), '..'), File.join(File.dirname(__FILE__), '..', 'lib/fluent/plugin'), File.join(File.dirname(__FILE__), '..', 'spec'), ].each do |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) end require 'splunk_metrics_parser' require 'date' require 'rspec' RSpec.describe SplunkMetricsParser do describe "#emit_parsed_metrics" do it 'should read sample Artifactory metrics data and verify the size of parsed data > 1' do platform_metrics = File.read('./spec/fixtures/files/sample_artifactory_metrics.txt') expect(platform_metrics.size).to be > 1 parser = SplunkMetricsParser.new('jfrog.artifactory', '', 'jfrog.artifactory.metrics') normalized_data = parser.normalise_data(platform_metrics) expect(normalized_data.size).to be > 1 cleaned_data = parser.clean_data(normalized_data) expect(cleaned_data.size).to be > 1 hash_data_array = parser.format_data(cleaned_data, 'jfrog.artifactory', '.') expect(hash_data_array.size).to be > 1 serialized_data = parser.serialize_data(hash_data_array) expect(serialized_data.size).to be > 1 end it 'should read sample Xray metrics data and verify the size of parsed data > 1' do platform_metrics = File.read('./spec/fixtures/files/sample_xray_metrics.txt') expect(platform_metrics.size).to be > 1 parser = SplunkMetricsParser.new('jfrog.xray', '', 'jfrog.xray.metrics') normalized_data = parser.normalise_data(platform_metrics) expect(normalized_data.size).to be > 1 cleaned_data = parser.clean_data(normalized_data) expect(cleaned_data.size).to be > 1 hash_data_array = parser.format_data(cleaned_data, 'jfrog.xray', '.') expect(hash_data_array.size).to be > 1 serialized_data = parser.serialize_data(hash_data_array) expect(serialized_data.size).to be > 1 end end end
Version data entries
17 entries across 17 versions & 1 rubygems