index_document_small

in profile/benchmarking/simple.rb [117:146]


      def index_document_small(opts={})
        results = []
        document = small_document
        action_iterations = 10

        warmup_repetitions.times do
          client.create(index: INDEX, body: document)
        end

        duration = with_cleanup do
          Benchmark.realtime do
            results = measured_repetitions.times.collect do
              Benchmark.realtime do
                action_iterations.times do
                  client.create(index: INDEX, body: document)
                end
              end
            end
          end
        end

        options = { duration: duration,
                    operation: __method__,
                    dataset: 'small_document',
                    dataset_size: ObjectSpace.memsize_of(small_document),
                    dataset_n_documents: 1,
                    action_iterations: action_iterations }
        index_results!(results, options)
      end