def record_query_details(self, call, request, response, trace):
    details = trace.mutable_datastore_details()
    if not response.keys_only():


      for entity in response.result_list():
        newent = details.add_keys_read()
        newent.CopyFrom(entity.key())
    if call == 'RunQuery':

      if config.DATASTORE_DETAILS:
        if request.has_kind():
          details.set_query_kind(request.kind())
        if request.has_ancestor():
          ancestor = details.mutable_query_ancestor()
          ancestor.CopyFrom(request.ancestor())


        if response.has_cursor():
          details.set_query_nextcursor(response.cursor().cursor())

      baseline_reads = 1
    elif call == 'Next':



      if config.DATASTORE_DETAILS:
        details.set_query_thiscursor(request.cursor().cursor())
        if response.has_cursor():
          details.set_query_nextcursor(response.cursor().cursor())
      baseline_reads = 0

    if config.CALC_RPC_COSTS:
      num_results = len(response.result_list()) + response.skipped_results()
      cost_micropennies = config.DATASTORE_READ_OP_COST * baseline_reads
      if response.keys_only():

        cost_micropennies += config.DATASTORE_SMALL_OP_COST * num_results
        trace.set_call_cost_microdollars(cost_micropennies)
        _add_billed_op_to_trace(trace, baseline_reads,
                                datamodel_pb.BilledOpProto.DATASTORE_READ)
        _add_billed_op_to_trace(trace, num_results,
                                datamodel_pb.BilledOpProto.DATASTORE_SMALL)
      else:

        cost_micropennies += config.DATASTORE_READ_OP_COST * num_results
        trace.set_call_cost_microdollars(cost_micropennies)
        _add_billed_op_to_trace(trace, num_results + baseline_reads,
                                datamodel_pb.BilledOpProto.DATASTORE_READ)
Recursively incref the given *value* and its members.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/appstats/recording.py/Recorder.record_query_details--crossover with--dataset/ETHPy150Open numba/numba/numba/targets/base.py/BaseContext.nrt_incref