Grid measurements can be fetched from REST API.
The base URI for grid measuremetns REST API is:
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:
If you call below query, QuickBuild will return all measurements collected from all nodes in the last one hour.
Below query will return all measurements from myagent:8811 in the last one hour.
/rest/grid/measurements?source=myagent:8811
Below query will return measurements of disk usage for all nodes in the last one hour.
/rest/grid/measurements?metric=disk.usage
Below query returns all measurements for all nodes in the last 2 hours.
/rest/grid/measurements?period=LAST_2_HOURS
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.
/rest/grid/measurements?start_time=2013-02-25T09:47:00.000%2B08:00
Below query returns all measurements for all nodes in a specified time range with a custom date format pattern:
/rest/grid/measurements?start_time=2013/02/25+09:47&end_time=2013/02/27+09:47&date_pattern=yyyy/MM/dd+HH:mm
For all query above, below is an example return result:
<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>
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.
Below table shows all available measurement metrics:
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 |
Metric Id | Metric Name | Applied to |
---|
cpu.totalUsage | CPU :: Total Usage | All Nodes |
Metric Id | Metric Name | Applied to |
---|
memory.usage | Physical Memory :: Memory Usage | Server Only |
Metric Id | Metric Name | Applied to |
---|
disk.usage | Disk :: Usage | All Nodes |
Metric Id | Metric Name | Applied to |
---|
network.txBytes | Network :: txBytes | Server Only |
network.rxBytes | Network :: rxBytes | Server Only |
Metric Id | Metric Name | Applied to |
---|
swap.usage | Swap :: Usage | Server Only |
Metric Id | Metric Name | Applied to |
---|
resources.percentage | Resource :: Used% | Server Only |
resources.frees | Resource :: Frees | Server Only |
resources.used | Resource :: Used | Server Only |
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 |
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 |
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 |
Metric Id | Metric Name | Applied to |
---|
db.numConnections | Database :: Total Connections | Server Only |
db.busyConnections | Database :: Busy Connections | Server Only |
Metric Id | Metric Name | Applied to |
---|
jetty.totalConnections | Jetty :: Total Connections | Server Only |
jetty.usedConnections | Jetty :: Used Connections | Server Only |
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 |
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 |
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 |
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 |
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 |
No, Any user can use the functions.