show mrtable-agent-statistics

show mrtable-agent-statistics [-agent <agentID>][-table <tableName>][-json]

Shows the latest statistics as of the last one minute for multi-region table agents. With no arguments, this command shows combined statistics over all regions the MR Table spans.

Input Parameters

Optionally, you can enable the following flags with appropriate parameters with this command:

Table A-1 Input Parameters

Flag Parameter Description
- agent agentID Limits the statistics to the agent ID specified. You can find the agent ID from the JSON config file created while configuring your agent. See Configure XRegion Service.
- table tableName Limits the statistics to the MR Table specified.
- json - Returns the complete statistics in JSON format. Even though the statistics are returned in JSON format by default, specifying this flag adds additional information in the output such as operation, return code, and the return code's description.

Output Statistics

The statistics reported by the show mrtable-agent-statistics can be categorized as those used to:
  • Monitor streams from other regions

    Table A-2 Output Statistics 1

    Statistic Description
    completeWriteOps Number of complete write operations per region.
    lastMessageMs

    Timestamp when the agent sees the last message from a remote region, in milliseconds.

    If this statistic information is not available, -1 is printed as its output value.

    lastModificationMs

    Timestamp of the last operation performed in each remote region, in milliseconds.

    If this statistic information is not available, -1 is printed as its output value.
    laggingMs (avg, max, min)

    In a multi-region KVStore, each shard in a region pushes all the operations performed on all its tables to the agent's queue. The agent replicates the contents of its queue, in event order, to all other regions. The lagging statistic represents the time difference between an event being pushed into the queue and replicated to the other regions by the agent. If this value is high, it indicates that the queue is getting backed up. A smaller value indicates that the agent is able to keep up with the number of events coming from remote regions. The lagging statistics are reported as average, minimum, and maximum in milliseconds for each remote region.

    If this statistic information is not available, -1 is printed as its output value.

    latencyMs (avg, max, min) In MR tables, the latency statistic indicates the time taken in milliseconds for each operation to travel from its origin (remote) region to the target (local) region.
    The latency is computed as T2 - T1, where:
    • T1 is the timestamp when an operation is performed in the remote region, and
    • T2 is the timestamp when the agent persisted the replicated operation to the local region.
    For each remote region, the latency statistics are reported as the average, minimum, and maximum latency for all the operations from that region.

    If this statistic information is not available, -1 is printed as its output value.

  • Check the persistence of remote data

    Table A-3 Output Statistics 2

    Statistic Description
    puts Number of write operations received.
    dels Number of delete operations received.
    streamBytes Total bytes replicated from a remote region.
    persistStreamBytes Reports the total number of bytes that are successfully committed in the local region. This is different from the total bytes replicated from a remote region because in case of any conflicts with operations from other regions, some of the operations may not persist if they fail the built-in conflict resolution rule.
    winPuts Number of write operations performed successfully. More specifically, this statistic excludes the writes that failed to win the conflict resolution rule, in case of a conflict with writes in other regions.
    winDels Number of delete operations performed successfully. More specifically, this statistic excludes the deletes that failed to win the conflict resolution rule, in case of a conflict with deletes in other regions.
    incompatibleRows Number of operations that did not persist because of incompatible table schemas. This can happen when there is a schema mismatch between the origin region and the region that is trying to replicate the row to its local data store.
  • Monitor the interaction between admin and the agent

    Table A-4 Output Statistics 3

    Statistic Description
    requests All the DDL commands executed by the user on an MR table are converted into requests to the agent by the admin. This statistic reports the number of requests posted by the admin.
    responses Number of requests processed and responded by the agent.
  • Monitor multi-region tables
    When you execute the show mrtable-agent-statistics command with the -table flag, it returns the table level statistics indicating:
    1. Persistence of remote data in the local region: This includes the statistics such as puts, dels, winPuts, winDels, streamBytes, persistStreamBytes, and incompatibleRows discussed above.
    2. Progress of table initialization in each remote region: This is indicated by the state attribute under the Initialization statistics in the output. The table below lists the different possible values for state and their meaning.

      Table A-5 Table Initialization States

      State Description
      NOT_START MR table initialization has not started, or there is no need to do initialization. For example, if the agent resumes the stream from an existing checkpoint successfully, there is no need to re-initialize the MR table.
      IN_PROGRESS MR table initialization is ongoing, that is, the MR table initialization has started and the data is being replicated from the remote regions.
      COMPLETE MR table initialization is complete and table transfer is done. The agent is streaming from the remote region.
      ERROR MR table initialization cannot complete because of an irrecoverable error. You can view the error severity in the agent log as WARNING or SEVERE. The agent log can be found in the directory specified in the JSON config file. See Configure XRegion Service.
      SHUTDOWN MR table initialization cannot complete because the service is shut down.
    3. Persistence of the table data per remote region:

      Table A-6 Output Statistics 4

      Statistic Description
      transferStartMs

      Timestamp of the initiation of table initialization, in milliseconds.

      If this statistic information is not available, -1 is printed as its output value.

      transferCompleteMs

      Timestamp of the completion of table initialization, in milliseconds.

      If this statistic information is not available, -1 is printed as its output value.
      elapsedMs The time elapsed from the start of the table initialization until its completion.

      elapsedMs = transferCompleteMs - transferStartMs

      This statistic is reported in milliseconds. Before the transfer completion, it reports -1 indicating the unavailability of this statistic.

      transferBytes Number of bytes transferred from the remote (origin or source) region to the local (target) region.
      transferRows Number of rows transferred from the remote region to the local region successfully.
      expireRows Number of rows expired before transferring from the remote region. Because of their TTL value, some rows might expire during the replication. Such rows expire by the time they reach the agent. This statistic counts such expired rows.
      persistBytes Reports the total number of bytes that are successfully committed in the local region. This excludes the rows that are not committed in the local region because they failed the built-in conflict resolution rule. In case of row updates, the entire row is counted for this statistic.
      persistRows Reports the total number of rows that are successfully committed in the local region. Similar to the above statistic, the rows that are not committed in the local region because of the built-in conflict resolution rule are excluded for this count.

Example

Below are a few examples of the statistics returned by the show mrtable-agent-statistics command with different input parameters.

Note:

If any of the statistics information is not available, -1 is reported as the value for that statistic parameter in the output.
# MR table agent statistics for a specific agent 
kv-> show mrtable-agent-statistics -agent 0 -json
{
  "operation": "show mrtable-agent-statistics",
  "returnCode": 5000,
  "description": "Operation ends successfully",
  "returnValue": {
    "XRegionService-1_0": {
      "timestamp": 1592901180001,
      "statistics": {
        "agentId": "XRegionService-1_0",
        "beginMs": 1592901120001,
        "dels": 1024,
        "endMs": 1592901180001,
        "incompatibleRows": 100,
        "intervalMs": 60000,
        "localRegion": "slc1",
        "persistStreamBytes": 524288,
        "puts": 2048,
        "regionStat": {
          "lnd": {
            "completeWriteOps": 10,
            "laggingMs": {
              "avg": 512,
              "max": 998,
              "min": 31
            },
            "lastMessageMs": 1591594977587,
            "lastModificationMs": 1591594941686,
            "latencyMs": {
              "avg": 20,
              "max": 40,
              "min": 10
            }
          },
          "dub": {
            "completeWriteOps": 20,
            "laggingMs": {
              "avg": 535,
              "max": 1024,
              "min": 45
            },
            "lastMessageMs": 1591594978254,
            "lastModificationMs": 1591594956786,
            "latencyMs": {
              "avg": 30,
              "max": 45,
              "min": 15
            }
          }
        },
        "requests": 12,
        "responses": 12,
        "streamBytes": 1048576,
        "winDels": 1024,
        "winPuts": 2048
      }
    }
  }
}
# MR table agent statistics for a specific MR table 
kv-> show mrtable-agent-statistics -table users -json
{
  "operation": "show mrtable-agent-statistics",
  "returnCode": 5000,
  "description": "Operation ends successfully",
  "returnValue": {
    "XRegionService-1_0": {
      "tableID": 12,
      "tableName": "users",
      "timestamp": 1592901300001,
      "statistics": {
        "agentId": "XRegionService-1_0",
        "beginMs": 1592901240001,
        "dels": 1000,
        "endMs": 1592901300001,
        "expiredPuts": 200,
        "incompatibleRows": 100,
        "initialization": {
          "lnd": {
            "elapsedMs": 476,
            "expireRows": 100,
            "persistBytes": 6492160,
            "persistRows": 6340,
            "state": "COMPLETE",
            "transferBytes": 8115200,
            "transferCompleteMs": 1592822625333,
            "transferRows": 7925,
            "transferStartMs": 1592822624857
          },
          "dub": {
            "transferStartMs": 0,
            "transferCompleteMs": 0,
            "elapsedMs": -1,
            "transferRows": 0,
            "persistRows": 0,
            "expireRows": 0,
            "transferBytes": 0,
            "persistBytes": 0,
            "state": "NOT_START"
          }
        },
        "intervalMs": 60000,
        "localRegion": "fra",
        "persistStreamBytes": 104960000,
        "puts": 100000,
        "streamBytes": 115200000,
        "tableId": 12,
        "tableName": "users",
        "winDels": 745,
        "winPuts": 90000
      }
    }
  }
}