Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1390

Metrics in FTS does not work as Documented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.0.3
    • 4.0.2
    • None
    • None
    • 1
    • SDK30

    Description

      In SDK 3.x, the Search Metrics can be fetched from the metrics property directly.

      In SDK 4.x, the metrics are not available in the same way anymore.

      Code Sample:

      from couchbase.cluster import Cluster, ClusterOptions
      from couchbase.auth import PasswordAuthenticator
      from couchbase.exceptions import CouchbaseException
      import couchbase.search as search

      cluster = Cluster.connect(
          “couchbase://localhost”,
          ClusterOptions(PasswordAuthenticator(“Administrator”, “password”)))
      bucket = cluster.bucket(“travel-sample”)
      collection = bucket.default_collection()

      try:
          result = cluster.search_query(
              “travel-sample-index”, search.QueryStringQuery(“swanky”))

          for row in result.rows():
              print(“Found row: {}“.format(row))

          print(“Reported total rows: {}“.format(
              result.metadata().metrics.total_rows))

      except CouchbaseException as ex:
          import traceback
          traceback.print_exc()

      Exception

      Error:'function' object has no attribute 'total_rows'

      I could not figure out how to get the total_rows or other metrics in the SDK 4.x.

      Observations

      • metrics is being interpreted as a method instead of property.
      • And the method metrics() returns None.

      Attachments

        Activity

          People

            jared.casey Jared Casey
            nithish.raghunandanan Nithish Raghunandanan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty