Performance Monitor

Introduction

In order to grasp the performance of iotdb, we add this module to count the time-consuming of each operation. This module can statistic the avg time-consuming of each operation and the proportion of each operation fall into a time range. The output is in log_measure.log file. A output example is in below.

Performance Monitor - 图1

Configuration parameter

location:conf/iotdb-engine.properties

**Table -parameter and description**

ParameterDefault ValueDescription
enable_performance_statfalseIs stat performance of sub-module enable.
performance_stat_display_interval60000The interval of display statistic result in ms.
performance_stat_memory_in_kb20The memory used for performance_stat in kb.

JMX MBean

Connect to jconsole with port 31999,and choose ‘MBean’in menu bar. Expand the sidebar and choose ‘org.apache.iotdb.db.cost.statistic’. You can Find:

Performance Monitor - 图2

Attribute

  1. EnableStat:Whether the statistics are enable or not, if it is true, the module records the time-consuming of each operation and prints the results; It can not be set dynamically but changed by function in below.

  2. DisplayIntervalInMs:The interval between print results. It can be set dynamically, but will take effect after restart.( First call stopStatistic(), then call startContinuousStatistics() or startOneTimeStatistics())

  3. OperationSwitch:It’s a map to indicate whether stat the operation, the key is operation name and the value is stat state. This parameter cannot be changed directly, it’s change by operation ‘changeOperationSwitch()’.

Operation

  1. startContinuousStatistics: Start the statistics and output at interval of ‘DisplayIntervalInMs’.
  2. startOneTimeStatistics:Start the statistics and output in delay of ‘DisplayIntervalInMs’.
  3. stopStatistic:Stop the statistics.
  4. clearStatisticalState(): clear current stat result, reset statistical result.
  5. changeOperationSwitch(String operationName, Boolean operationState):set whether to monitor operation status. The param ‘operationName’ is the name of operation, defined in attribute operationSwitch. The param operationState is the state of operation. If state-switch successful the function will return true, else return false.

Adding Custom Monitoring Items for developer of IOTDB

Add Operation

Add an enumeration in org.apache.iotdb.db.cost.statistic.Operation.

Add Timing Code in Monitoring Area

Add timing code in the monitoring start area:

  1. long t0 = System. currentTimeMillis();

Add timing code in the monitoring stop area:

  1. Measurement.INSTANCE.addOperationLatency(Operation, t0);