changes.
| Grid measurements can be fetched from REST API. |
| |
| h2. Available Functions |
| The base URI for grid measuremetns REST API is: |
| {code} |
| /rest/grid/measurements |
| {code} |
| |
| The support functions include: |
| |
| ||URI||Description||Params|| |
| |/rest/grid/measurements/help|Get help for all available functions|NO PARAMS| |
| |/rest/grid/measurements/version|Get current version for the measurements related REST API|NO PARAMS| |
| |/rest/grid/measurements|Query for the measurements you want|* source - *QUERY_PARAM* |
| Specify the node you want to query. If not specifed, then all nodes will be used. |
| * period - *QUERY_PARAM* |
| Specify the time range you want to query. by default, period is LAST_HOUR, this param can be one of: LAST_HOUR, LAST_2_HOURS, LAST_4_HOURS, LAST_DAY, LAST_WEEK, LAST_MONTH |
| * start_time - *QUERY_PARAM* |
| Specify the start time you want to query. If not specified, then an hour ago of to_date will be used. |
| * end_time - *QUERY_PARAM* |
| Specify the end time you want to query. If not specified, then current time will be used. |
| * metric - *QUERY_PARAM* |
| Specify the metric name you want to query. See below section for all available metric names |
| * date_pattern - *QUERY_PARAM* |
| Specify the date pattern you are using for from_date and to_date. By default, ISO 8601 is used.| |
| |
| Below, we'd like to give some examples for how to query the measurements: |
| |
| h3. With no params |
| If you call below query, QuickBuild will return all measurements collected from all nodes in the last one hour. |
| {code} |
| /rest/grid/measurements |
| {code} |
| |
| h3. Query for a specified node |
| Below query will return all measurements from _myagent:8811_ in the last one hour. |
| {code} |
| /rest/grid/measurements?source=myagent:8811 |
| {code} |
| |
| h3. Query for a specified metric |
| Below query will return measurements of _disk usage_ for all nodes in the last one hour. |
| {code} |
| /rest/grid/measurements?metric=disk.usage |
| {code} |
| |
| | h3. Query for a specific time range |
| | h3. Query for a specified time range |
| Below query returns all measurements for all nodes in the last 2 hours. |
| {code} |
| /rest/grid/measurements?period=LAST_2_HOURS |
| {code} |
| |
| Below query returns all measurements for all nodes from time: 2013-02-25T09:47:00+08:00, note by default, you need format your time in ISO8601 format, that is, in pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ, we will give a custom date pattern in later sample. |
| |
| {code} |
| /rest/grid/measurements?start_time=2013-02-25T09:47:00.000%2B08:00 |
| {code} |
| |
| Below query returns all measurements for all nodes in a specified time range with a custom date format pattern: |
| {code} |
| /rest/grid/measurements?start_time=2013/02/25+09:47&end_time=2013/02/27+09:47&date_pattern=yyyy/MM/dd+HH:mm |
| {code} |
| |
| h2. Example return result |
| For all query above, below is an example return result: |
| {code:xml} |
| <list> |
| <com.pmease.quickbuild.model.MeasurementDataR00> |
| <id>350</id> |
| <timestamp>1361854800000</timestamp> |
| <source>Zhenyu-MBP.local:8811</source> |
| <metricName>memory.usage</metricName> |
| <value>0.743398666381836</value> |
| </com.pmease.quickbuild.model.MeasurementDataR00> |
| <com.pmease.quickbuild.model.MeasurementDataR00> |
| <id>335</id> |
| <timestamp>1361854800000</timestamp> |
| <source>Zhenyu-MBP.local:8810</source> |
| <metricName>web.rpc.oneMinuteRate</metricName> |
| <value>10.3903417298681</value> |
| </com.pmease.quickbuild.model.MeasurementDataR00> |
| <com.pmease.quickbuild.model.MeasurementDataR00> |
| <id>334</id> |
| <timestamp>1361854800000</timestamp> |
| <source>Zhenyu-MBP.local:8810</source> |
| <metricName>web.rpc.fiveMinuteRate</metricName> |
| <value>8.90793420070343</value> |
| </com.pmease.quickbuild.model.MeasurementDataR00> |
| </list> |
| {code} |
| |
| Here, timestamp is the milliseconds in Java time (the time from midnight, January 1, 1970 UTC.), you can simply create your own Date instance by _new Date(timestamp)_ in Java. |
| |
| h2. Available Measurement Metrics |
| |
| Below table shows all available measurement metrics: |
| |
| h3. Virtual Machine Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |jvm.memoryUsage|Virtual Machine :: Memory Usage|All Nodes| |
| |jvm.heapUsage|Virtual Machine :: Heap Usage|Server Only| |
| |jvm.gcRuns|Virtual Machine :: GC Runs|Server Only| |
| |jvm.gcTime|Virtual Machine :: GC Time|Server Only| |
| |jvm.threadCount|Virtual Machine :: Thread Count|Server Only| |
| |
| h3. CPU Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |cpu.totalUsage|CPU :: Total Usage|All Nodes| |
| |
| h3. Physical Memory Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |memory.usage|Physical Memory :: Memory Usage|Server Only| |
| |
| h3. Disk Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |disk.usage|Disk :: Usage|All Nodes| |
| |
| h3. Network Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |network.txBytes|Network :: txBytes|Server Only| |
| |network.rxBytes|Network :: rxBytes|Server Only| |
| |
| h3. Swap Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |swap.usage|Swap :: Usage|Server Only| |
| |
| h3. Resource Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |resources.percentage|Resource :: Used%|Server Only| |
| |resources.frees|Resource :: Frees|Server Only| |
| |resources.used|Resource :: Used|Server Only| |
| |
| h3. Build Requests Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |buildrequests.processingsTotal|Build Requests :: Processings Total|Server Only| |
| |buildrequests.waitingsTotal|Build Requests :: Waitings Total|Server Only| |
| |buildrequests.processedTotal|Build Requests :: Processed Total|Server Only| |
| |buildrequests.processings|Build Requests :: Processings on Node|All Nodes| |
| |buildrequests.waitings|Build Requests :: Waitings on Node|All Nodes| |
| |
| h3. Builds Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |builds.total|Builds :: Total Builds|Server Only| |
| |builds.failed|Builds :: Failed Builds|Server Only| |
| |builds.successfulRate|Builds :: Successful Rate|Server Only| |
| |builds.averageDuration|Builds :: Average Duration|Server Only| |
| |builds.averageWaitingDuration|Builds :: Average Waiting Duration|Server Only| |
| |
| h3. Steps Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |steps.runningsTotal|Steps :: Runnings Total|Server Only| |
| |steps.waitingsTotal|Steps :: Waitings Total|Server Only| |
| |steps.runnings|Steps :: Runnings on Node|All Nodes| |
| |
| h3. Database Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |db.numConnections|Database :: Total Connections|Server Only| |
| |db.busyConnections|Database :: Busy Connections|Server Only| |
| |
| h3. Jetty(web server) Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |jetty.totalConnections|Jetty :: Total Connections|Server Only| |
| |jetty.usedConnections|Jetty :: Used Connections|Server Only| |
| |
| h3. UI Visits Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |web.ui.oneMinuteRate|UI Visits :: One-minute Rate|Server Only| |
| |web.ui.fiveMinuteRate|UI Visits :: Five-minute Rate|Server Only| |
| |web.ui.fifteenMinuteRate|UI Visits :: Fifteen-minute Rate|Server Only| |
| |web.ui.requests|UI Visits :: Requests|Server Only| |
| |web.ui.averageDuration|UI Visits :: Average Duration|Server Only| |
| |
| h3. REST Visits Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |web.rest.oneMinuteRate|REST Visits :: One-minute Rate|Server Only| |
| |web.rest.fiveMinuteRate|REST Visits :: Five-minute Rate|Server Only| |
| |web.rest.fifteenMinuteRate|REST Visits :: Fifteen-minute Rate|Server Only| |
| |web.rest.requests|REST Visits :: Requests|Server Only| |
| |web.rest.averageDuration|REST Visits :: Average Duration|Server Only| |
| |
| h3. RPC Visits Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |web.rpc.oneMinuteRate|RPC Visits :: One-minute Rate|Server Only| |
| |web.rpc.fiveMinuteRate|RPC Visits :: Five-minute Rate|Server Only| |
| |web.rpc.fifteenMinuteRate|RPC Visits :: Fifteen-minute Rate|Server Only| |
| |web.rpc.requests|RPC Visits :: Requests|Server Only| |
| |web.rpc.averageDuration|RPC Visits :: Average Duration|Server Only| |
| |
| h3. Download Visits Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |web.download.oneMinuteRate |Download Visits :: One-minute Rate|Server Only| |
| |web.download.fiveMinuteRate |Download Visits :: Five-minute Rate|Server Only| |
| |web.download.fifteenMinuteRate |Download Visits :: Fifteen-minute Rate|Server Only| |
| |web.download.requests |Download Visits :: Requests|Server Only| |
| |web.download.averageDuration |Download Visits :: Average Duration|Server Only| |
| |
| h3. Upload Visits Measurements |
| ||Metric Id||Metric Name||Applied to|| |
| |web.upload.oneMinuteRate |Upload Visits :: One-minute Rate|Server Only| |
| |web.upload.fiveMinuteRate |Upload Visits :: Five-minute Rate|Server Only| |
| |web.upload.fifteenMinuteRate |Upload Visits :: Fifteen-minute Rate|Server Only| |
| |web.upload.requests |Upload Visits :: Requests|Server Only| |
| |web.upload.averageDuration |Upload Visits :: Average Duration|Server Only| |
| |
| h2. Security |
| |
| No, Any user can use the functions. |