class_docstr: run insert
class_docstr_tok: ["run","insert"]
code: def run_case(self, case_metric, **case_param):
      collection_name = case_param["collection_name"]
      dimension = case_param["dimension"]
      index_field_name = case_param["index_field_name"]
      build_index = case_param["build_index"]
  
      tmp_result = self.insert(
          self.milvus,
          collection_name,
          case_param["data_type"],
          dimension,
          case_param["collection_size"],
          case_param["ni_per"],
      )
      flush_time = 0.0
      build_time = 0.0
      if case_param["flush_after_insert"] is True:
          start_time = time.time()
          self.milvus.flush()
          flush_time = round(time.time() - start_time, 2)
          logger.debug(self.milvus.count())
      if build_index is True:
          logger.debug("Start build index for last file")
          start_time = time.time()
          self.milvus.create_index(
              index_field_name,
              case_param["index_type"],
              case_param["metric_type"],
              index_param=case_param["index_param"],
          )
          build_time = round(time.time() - start_time, 2)
      tmp_result.update(
          {"flush_time": flush_time, "build_time": build_time}
      )
      return tmp_result
  
file_path: milvus/tests/benchmark/milvus_benchmark/runners/insert.py
imports: import time
  import copy
  import logging
  from milvus_benchmark import parser
  from milvus_benchmark.runners import utils
  from milvus_benchmark.runners.base import BaseRunner
label_desc: Use image node_id 4 for calling the InsertRunner obj's underlying member method code with example usage: obj.run_case(case_metric) and returns: tmp_result