# SHOW FULLTEXT SERVICE METRICS

Displays metrics for the JLucene full-text search in JSON format.

This command shows the diagnostic metrics from the JLucene service (JLucene co-process on each node) used by SingleStore's VERSION 2 full-text search system. These metrics are tracked from the instantiation of the JLucene co-process, and thus the values reflect metrics for the lifetime of the JLucene co-process on each node.

Refer to [Working with Full-Text Search](https://docs.singlestore.com/db/v9.1/developer-resources/functional-extensions/working-with-full-text-search.md) for related information.

## Syntax

```sql
SHOW FULLTEXT SERVICE METRICS [LOCAL | FOR NODE <node_id>]
```

## Arguments

If the `LOCAL` and `FOR NODE` clauses are not specified, the `SHOW FULLTEXT SERVICE METRICS` command displays metrics for all the nodes in the SingleStore deployment.

These clauses modify the output as follows:

* `LOCAL`: Display metrics for the current node.
  ```sql
  SHOW FULLTEXT SERVICE METRICS LOCAL;
  ```
* `FOR NODE <node_id>`: Display metrics for the node with the specified ID.
  ```sql
  SHOW FULLTEXT SERVICE METRICS FOR NODE <node_id>;
  ```
  This command can only be run on the aggregator node or on the node with the specified `<node_id>`.

## Output Metrics

The following table lists the metrics tracked for each JLucene co-process.

| Metric                 | Description                                                                                                                  |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `connections`          | Total number of accepted connections.                                                                                        |
| `requests`             | Total number of requests made for all the connections.                                                                       |
| `completed`            | Total number of completed requests.                                                                                          |
| `waiting`              | Total number of requests waiting for execution (data has been read, but the request has not yet begun execution).            |
| `errors`               | Total number of requests that returned an error.                                                                             |
| `maxThreads`           | Highest number of active threads in the thread pool since the instantiation of the JLucene co-process.                       |
| `maxQueue`             | Highest number of requests in the thread pool queue waiting for execution since the instantiation of the JLucene co-process. |
| `readCount`            | Total number of reads performed from the main and control sockets.                                                           |
| `waitDuration`         | Number of milliseconds a request waits, from the first read, before execution.                                               |
| `functionDuration`     | Total number of milliseconds spent in the function.                                                                          |
| `executeDuration`      | Total number of milliseconds spent executing the requests.                                                                   |
| `activeThreads`        | Number of active threads executing requests.                                                                                 |
| `activeControlThreads` | Number of active threads for the control socket executing requests.                                                          |

## Example

The following example displays metrics for a full-text search run on a SingleStore deployment with one aggregator and one leaf node.

**Note**: The output is JSON formatted for readability.

```sql
SHOW FULLTEXT SERVICE METRICS \G

```

```output

*** 1. row ***
Node ID: 1
Metrics: {
  "requests": 2,
  "completed": 1,
  "errors": 0,
  "readCount": 2,
  "waitDuration": 36,
  "functionDuration": 174,
  "executeDuration": 179,
  "upTime": "0:00:14",
  "connections": 2,
  "waiting": 0,
  "maxThreads": 9,
  "maxQueue": 0,
  "requestsByFunction": {
    "jlucene_metrics": {
      "requests": 2,
      "completed": 1,
      "errors": 0,
      "readCount": 2,
      "waitDuration": 36,
      "functionDuration": 174,
      "executeDuration": 179
    }
  },
  "activeThreads": 1,
  "activeControlThreads": 0,
  "indexSearcherCacheStats": {
    "requestCount": 0,
    "hitCount": 0,
    "hitRate": 1,
    "loadCount": 0,
    "missCount": 0,
    "missRate": 0,
    "evictionCount": 0,
    "indexFilesInMemorySize": 0,
    "indexFilesTempFileSize": 0
  }
}
*** 2. row ***
Node ID: 2
Metrics: {
  "requests": 16,
  "completed": 15,
  "errors": 0,
  "readCount": 18,
  "waitDuration": 89,
  "functionDuration": 7288,
  "executeDuration": 7765,
  "upTime": "0:00:48",
  "connections": 17,
  "waiting": 0,
  "maxThreads": 32,
  "maxQueue": 1,
  "requestsByFunction": {
    "jlucene_metrics": {
      "requests": 2,
      "completed": 1,
      "errors": 0,
      "readCount": 2,
      "waitDuration": 2,
      "functionDuration": 10,
      "executeDuration": 11
    },
    "jlucene_index": {
      "requests": 7,
      "completed": 7,
      "errors": 0,
      "readCount": 7,
      "waitDuration": 65,
      "functionDuration": 6452,
      "executeDuration": 6796
    },
    "jlucene_search": {
      "requests": 7,
      "completed": 7,
      "errors": 0,
      "readCount": 9,
      "waitDuration": 22,
      "functionDuration": 826,
      "executeDuration": 958
    }
  },
  "activeThreads": 1,
  "activeControlThreads": 0,
  "indexSearcherCacheStats": {
    "requestCount": 0,
    "hitCount": 0,
    "hitRate": 1,
    "loadCount": 0,
    "missCount": 0,
    "missRate": 0,
    "evictionCount": 0,
    "indexFilesInMemorySize": 0,
    "indexFilesTempFileSize": 0
  }
}

```

***

Modified at: November 14, 2024

Source: [/db/v9.1/reference/sql-reference/show-commands/show-fulltext-service-metrics/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/show-commands/show-fulltext-service-metrics/)

(An index of the documentation is available at /llms.txt)
