Sha256: 8b196bdb710435f372b207de8c41637288cddc3ff7fdd262c3793fc1b24e7f47

Contents?: true

Size: 875 Bytes

Versions: 9

Compression:

Stored size: 875 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')

require 'benchmark'
require 'benchmark/memory'

describe "file projection" do
  it "projects file streams" do
    schema = {
      "forced" => nil,
      "created" => nil,
      "pusher" => {
        "name" => nil,
      },
      "repository" => {
        "name" => nil,
        "full_name" => nil,
      },
      "ref" => nil,
      "compare" => nil,
      "commits" => {
        "distinct" => nil,
        "message" => nil,
        "url" => nil,
        "id" => nil,
        "author" => {
          "username" => nil,
        }
      }
    }

    file_path = ENV['JSON_FILE']
    if file_path.nil? || file_path.empty?
      return
    end

    Benchmark.memory { |x|
      x.report("project (yajl)") { Yajl::Projector.new(File.open(file_path, 'r')).project(schema) }
      x.compare!
    }
  end
end

Version data entries

9 entries across 9 versions & 5 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/spec/projection/project_file.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/spec/projection/project_file.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/spec/projection/project_file.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/spec/projection/project_file.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/yajl-ruby-1.4.3/spec/projection/project_file.rb
yajl-ruby-1.4.3 spec/projection/project_file.rb
yajl-ruby-1.4.2 spec/projection/project_file.rb
yajl-ruby-1.4.1 spec/projection/project_file.rb
yajl-ruby-1.4.0 spec/projection/project_file.rb