Arango logo

ArangoSearch Statistics HTTP API

The HTTP interface for ArangoSearch statistics is an observability feature that lets you inspect the index segments that back arangosearch Views and inverted indexes

Both arangosearch Views and inverted indexes store their data in ArangoSearch data stores. Every link of an arangosearch View and every inverted index has its own data store, and each data store is made up of immutable segments. New segments are created by commits, and the background consolidation process merges small segments into bigger ones and thereby removes documents that have been marked as deleted, as governed by the consolidation properties of the View or inverted index.

The ArangoSearch statistics API lets you look at these segments to understand how a data store is laid out, how much of it is occupied by deleted documents, and whether consolidation keeps up with the write load.

Get the ArangoSearch statistics (experimental)

GET http://<EXTERNAL_ENDPOINT>:8529/_arango/experimental/_db/:database-name/_admin/arangosearch/stats

Introduced in: v3.12.11

The ArangoSearch statistics API is incomplete and thus an experimental feature. It is only available on single servers, and the reported data stores of arangosearch Views cannot be mapped back to the View they belong to.

In v3.12.11, the endpoint reports the statistics of a single data store that you cannot select, as a flat object without the numIndexes and indexes attributes, and it returns an empty object if the database has no arangosearch View and no inverted index.

Returns the summarized statistics and the per-segment information of the ArangoSearch data stores of the specified database.

The endpoint enumerates the collections of the database and reports the statistics of every arangosearch View link and every inverted index it encounters, identified by the name and type of the index as well as the collection it belongs to. The order in which the data stores are reported is not defined and can change. If the database has no arangosearch View and no inverted index, then the list of data stores is empty.

You need at least read access to the specified database.

Path Parameters
  • The name of the database that holds the arangosearch Views or inverted indexes you want the statistics of.

    Example: _system

Query Parameters
    HTTP Headers
      Responses
      • The statistics were returned successfully. The indexes array is empty if the database contains no arangosearch View and no inverted index.

          Response Body application/json object
        • The list of ArangoSearch data stores of the database, each with its summarized statistics and per-segment information.

          • The name of the collection the index belongs to.

            Example: "coll"

          • The share of documents that are marked as deleted, calculated as (numDocs - numLiveDocs) / numDocs and rounded to two decimal places. It is 0 if the data store is empty. A high value indicates that the data store holds a lot of data that consolidation can still reclaim.

            Example: 0.17

          • The name of the index the data store belongs to.

            • For inverted indexes, this is the same as the name of the index, which can be user-defined.
            • For the internal indexes of arangosearch Views (links), this is an automatically generated name which cannot be mapped back to the View it belongs to.

            Example: "inv-idx"

          • The size of the data store in bytes, calculated as the sum of the sizes of all segments.

            Example: 4118

          • Possible values: "arangosearch", "inverted"

            The type of the index the data store belongs to, which is either arangosearch for a View link or inverted for an inverted index.

            Example: "inverted"

          • The number of documents in the data store, including the documents that are marked as deleted but that are not removed yet.

            Example: 6

          • The number of files that represent the data store. This includes the files of all segments as well as the segments file itself.

            Example: 12

          • The number of documents in the data store that are not marked as deleted.

            Example: 5

          • The number of top-level documents in the data store. It is equal to numDocs unless the View or inverted index indexes nested fields, in which case the child documents are not counted.

            Example: 6

          • The number of segments the data store is made up of.

            Example: 2

          • The list of segments the data store is made up of.

            • The size of the segment in bytes.

              Example: 3562

            • The share of documents in the segment that are marked as deleted, calculated as (numDocs - numLiveDocs) / numDocs and rounded to two decimal places. It is 0 if the segment holds no documents.

              Example: 0.2

            • The name of the segment as used on disk, for instance _1.

              Example: "_1"

            • The number of documents in the segment, including the documents that are marked as deleted but that are not removed yet.

              Example: 5

            • The number of documents in the segment that are not marked as deleted.

              Example: 4

        • The number of ArangoSearch data stores the statistics are reported for. It is equal to the length of the indexes array.

          Example: 2

      • The credentials are wrong, the user account is inactive, or the specified database doesn’t exist and the user account has no default access to it.

          Response Body application/json object
        • The HTTP response status code.

          Example: 401

        • A flag indicating that an error occurred.

          Example: true

        • A descriptive error message.

        • The ArangoDB error number for the error that occurred.

      • The specified database exists but the user account has no access to it.

          Response Body application/json object
        • The HTTP response status code.

          Example: 403

        • A flag indicating that an error occurred.

          Example: true

        • A descriptive error message.

        • The ArangoDB error number for the error that occurred.

      • The specified database doesn’t exist. revealed.

          Response Body application/json object
        • The HTTP response status code.

          Example: 404

        • A flag indicating that an error occurred.

          Example: true

        • A descriptive error message.

        • The ArangoDB error number for the error that occurred.

          Example: 1228

      • Returned when an HTTP method other than GET is used.

          Response Body application/json object
        • The HTTP response status code.

          Example: 405

        • A flag indicating that an error occurred.

          Example: true

        • A descriptive error message.

        • The ArangoDB error number for the error that occurred.

      • An internal error occurred while gathering or serializing the statistics.

          Response Body application/json object
        • The HTTP response status code.

          Example: 500

        • A flag indicating that an error occurred.

          Example: true

        • A descriptive error message.

        • The ArangoDB error number for the error that occurred.

      • Returned when the endpoint is called on a cluster deployment. The statistics are only available on single servers.

          Response Body application/json object
        • The HTTP response status code.

          Example: 501

        • A flag indicating that an error occurred.

          Example: true

        • A descriptive error message.

        • The ArangoDB error number for the error that occurred.

          Example: 1470

      Examples

      curl --header 'accept: application/json' --dump - http://localhost:8529/_arango/experimental/_db/_system/_admin/arangosearch/stats
      
      Show output
      {
        "numIndexes": 2,
        "indexes": [
          {
            "indexName": "idx_1780862094262272000",
            "indexType": "arangosearch",
            "collection": "coll",
            "numDocs": 6,
            "numLiveDocs": 5,
            "deletionRatio": 0.17,
            "numPrimaryDocs": 6,
            "numSegments": 2,
            "numFiles": 12,
            "indexSize": 4118,
            "segments": [
              {
                "name": "_1",
                "numDocs": 5,
                "numLiveDocs": 4,
                "byteSize": 3562,
                "deletionRatio": 0.2
              },
              {
                "name": "_2",
                "numDocs": 1,
                "numLiveDocs": 1,
                "byteSize": 556,
                "deletionRatio": 0
              }
            ]
          },
          {
            "indexName": "inv-idx",
            "indexType": "inverted",
            "collection": "coll2",
            "numDocs": 2,
            "numLiveDocs": 2,
            "deletionRatio": 0,
            "numPrimaryDocs": 2,
            "numSegments": 1,
            "numFiles": 6,
            "indexSize": 1247,
            "segments": [
              {
                "name": "_1",
                "numDocs": 2,
                "numLiveDocs": 2,
                "byteSize": 1201,
                "deletionRatio": 0
              }
            ]
          }
        ]
      }