Plugin Information |
---|
No information for the plugin 'statistics-notification' is available. It may have been removed from distribution. |
Description
- Plugin will capture job creation, deletion and update events and calls REST API. This also sends config.xml in the rest call.
- It will record the queue time for each and every build calling REST API. It captures Queue entry time and Queue exit time and other related parameters.
- It also records build information like start time, end time, build parameters, SCM parameters and Slave information and calls an API.
All of the above stats are captured in real time. API can be used to write the data to DB or can be used to notify the people.
Notification URL can be configured in system configuration page at http://localhost:9090/jenkins/configure as shown in below.
Notification URL is the API end point that can be used for capturing statistics. For ex. http://cistats.mycompany.com/api/ Final Queue end point will be http://cistats.mycompany.com/api/queues Projects/jobs end point will be http://cistats.mycompany.com/api/projects Builds end point will be http://cistats.mycompany.com/api/builds.
- Notification URL is the API end point that can be used for capturing statistics. For ex. http://cistats.mycompany.com/api/.
- Final Queue end point will be http://cistats.mycompany.com/api/queues.
- Projects/jobs end point will be http://cistats.mycompany.com/api/projects.
- Builds end point will be http://cistats.mycompany.com/api/builds.
- Connection Timeout: Determines the timeout until a connection is established. Default value is 1000ms.
- Socket Timeout: Defines the default socket timeout in milliseconds which is the timeout for waiting for data. Default value is 1000ms.
These are the only 3 configurations that user need to do.
Once they are set each time a job is created, deleted or updated an API will be called with following JSON.
{ "name": "create-10", "createdDate": "Jul 1, 2015 10:10:37 AM", "userId": "anonymous", "userName": "anonymous", "ciUrl": "http://localhost:9090/jenkins/", "status": "ACTIVE", "configFile": "<?xml version='1.0' encoding='UTF-8'?>\n<project>\n <keepDependencies>false<\/keepDependencies>\n <properties/>\n <scm class=\"hudson.scm.NullSCM\"/>\n <canRoam>false<\/canRoam>\n <disabled>false<\/disabled>\n <blockBuildWhenDownstreamBuilding>false<\/blockBuildWhenDownstreamBuilding>\n <blockBuildWhenUpstreamBuilding>false<\/blockBuildWhenUpstreamBuilding>\n <triggers/>\n <concurrentBuild>false<\/concurrentBuild>\n <builders/>\n <publishers/>\n <buildWrappers/>\n<\/project>" }
Sample JSON for the Queue API.
{ "duration":47, "entryTime":"2015-07-01T02:12:55.000Z", "exitTime":"2015-07-01T02:12:55.000Z", "jenkinsQueueId":4, "jobName":"test-2", "startedBy":"anonymous", "status":"LEFT", "queueCauses":{ "buildable":{ "entryTime":"2015-07-01T02:12:55.000Z", "exitTime":"2015-07-01T02:12:55.000Z", "reasonForWaiting":"Waiting for next available executor" }, "waiting":{ "entryTime":"2015-07-01T02:12:55.000Z", "exitTime":"2015-07-01T02:12:55.000Z", "reasonForWaiting":"???" } }, "ciUrl":"http://localhost:9090/jenkins/" }
Sample JSON for build API.
{ "jobName":"test-job", "number":19, "startTime":"2015-07-01T18:46:53.000Z", "startedUserId":"anonymous", "startedUserName":"anonymous", "result":"SUCCESS", "duration":42451, "queueTime":14917, "endTime":"2015-07-01T18:47:51.000Z", "ciName":"corepayteconnector-ci", "scmInfo":{ "url":"git@github.com:plugins/testplugin.git", "branch":"origin/develop", "commit":"12345567e7ada45db02db5fb" }, "parameters":{ "EMAIL_NOTIFICATION":"test@company.com" }, "slaveInfo":{ "slaveName":"computer name", "vmName":"VM name", "label":"java", "remoteFs":"/dev/hudson/" }, "ciUrl":"http://localhost:9090/jenkins" }
Attachments:
stats-plugin-system-config.png (image/png)
stats-plugin-system-config.png (image/png)
stats-plugin-system-config.png (image/png)
stats-plugin-system-config-1.png (image/png)