How to know Cube build have finished - kylin

I am using Kylin REST API to submit Cube build request, Kylin will build the cube asynchronously,
I would ask how to know that the Cube build request has been finished?

use the following REST endpoint to get the status of the cube
GET http://localhost:7070/kylin/api/jobs/{job_uuid}
in the returned json objec the field job_status would show the status of the cube build.

Related

how to get json response for build details from Jenkins build after it finishes

I have a Jenkins Server which runs a Jenkins job - JobA
and I have a Java Spring boot web service, where I store the Jenkins build data and serve it to various other systems.
I want that whenever JobA finishes each build, it should call an endpoint on my web service and post the build data (bascically the same data that I get from calling the Jenkins API: https://<my-jenkins-server>/job/JobA/<buildNumber>/api/json) to the end point of my web service, which accepts a POST requests and JSON payload to update the build details like job name, build number, build result, build url, build duration, timestamp, test results etc. in my database.
The endpoint of my web service should still be called even if the build fails.
I can already get all this data from the above REST API call, but I do not want to use that because, using that if I want to get the updated data in my database, I will have to poll the Jenkins REST API multiple times, (like maybe every 15 minutes or more frequently) which will increase the load on my Jenkins server.
I know that I can set up a Jenkins job to either call a script or call another downstream job through which I can then call a curl POST request to my end point.
But my problem is that I do not know where/how to get the JSON data for the build be sent in the POST request?
Can someone help me out please?
You can get the lastbuild information and there is a field called building which says if the build is running or not.
https://host/job/project/lastBuild/api/json?depth=1

I am trying to perform mobile load testing using Jmeter but i receive 401 error in result tree

I am trying to load test my mobile application using jmeter, I have given authorization token in HTTP header manager and recorded the mobile app operations. But when I run this recorded script and view the result in result tree, all of the operations appear as failed and for some i see 401 un-authorization error. Please help me in solving this problem.
This image shows the result I get after running the recorded
HTTP 401 status code means that you failed to provide correct credentials or token, you need either to login somehow or to pass a "good" token which your system expects.
In the majority of cases you cannot just replay recorded script without prior correlation - the process of extracting dynamic data from the previous response using a suitable Post-Processor, converting it into a JMeter Variable and adding it to the next request.
You can determine which parts of request are dynamic by recording the same actions once again and comparing the scripts. If there will be differences - you will need to handle the corresponding parameters.
Alternative option is using cloud-based proxy service for recording, it can export recorded requests in SmartJMX mode assuming automatic detection and correlation of any dynamic parameters. See How to Cut Your JMeter Scripting Time by 80% article for more information.

Need to View Travis CI Test Stats on Repo Pull Requests via the Travis API Calls

I am building a student manager rails app for a class project.I'm already using the Github API to look at an assignments pull requests. As students we fork our instructors assignment, clone it, make our changes, and then we submit pull requests of our completed assignments to turn in our work.
I'm now building an app that integrates all of these steps(and more), and I would like to add in the travis-ci test results to this app. I'm looking at their API, and I can't seem to find how I can show the travis build results for a repos pull requests?
I was wondering if anyone else would know, or could point me in the right direction... here is the link to their API docs... https://api.travis-ci.org/docs/
Thanks!
I've not used the Travis API before, so I'm sorry if I get something wrong. Also, I'm not sure if you're looking just for the status of the Travis build (e.g. success or failure), or the full logs -- so I'll try to cover both.
Fetch the pull request via its ID.
Extract the statuses link from the _links hash in the JSON response. This link points to the statuses for the last commit in the pull request, which are used to determine the overall status of the pull request.
Fetch the statuses link. The returned JSON document is an array of status descriptions. Each status has a status attribute which describes if the build is pending, success, error, or failure. The first status in the array is the latest status and this is what's used for the overall status of the pull request.
From the returned JSON body, extract the value of the target_url attribute of the first status in the array. For Travis CI builds, the value will be of this format: https://travis-ci.org/rails/rails/builds/:build_id.
From the extracted target_url parse out the ID of the build (:build_id).
Fetch the build from Travis using the ID you just parsed out.
The returned JSON hash will contain an array of build jobs called matrix. Iterate over this list of jobs to find the job you want to get logs for. The id attribute of each job uniquely identifies a job.
Fetch the job description using the id attribute of a job.
Extract the log attribute from the returned JSON description. This is the raw text log for that job.

How can I execute code after rendering a response to the client in Grails?

I am writing a controller in Grails 2.X which kicks off a longish job. I would like to be able to render something to the web page which states that the process has started, with the id of the job that is in progress, and have that response actually show up in the user's web browser, and then continue processing on the job.
I have tried just using render without returning, and the user's browser just hangs until the entire job has completed, then renders that the job started.
I tried redirecting to a different action that renders my message, but that also hangs the browser until the job is complete.
I have looked into using filters and the afterInterceptor, but as best as I can tell these take effect and do their processing before the final page is sent back to the client. I need to send my final page back to my client and then continue processing.
You will want to kick off a background job. You can use quartz or look at grails 2.3 async items. If it is pretty long using Quartz is probably your best option.
You will want to return something the client can use to query for the state of the job such as a job id or some record you update once processing is finished.

TFS 2010 build email notification when build is running beyond permissible time span

I am using TFS 2010 for build service. I need to send an email if the build is running for longer time.
For ex: Suppose the build normally runs for 10 mins, but now if the build is running for more than 20 mins... i need to send an email notification.
May I have your help on this?
This functionality is not available out of the box. This can however, make a great feature request, raise it for consideration here => http://visualstudio.uservoice.com/forums/121579-visual-studio
However, to get this to work here is what you can do... Write a tfs build activity which using the tfs api extracts the last build execution time and insert that at various places in the process workflow ideally before and after each work flow task to check how much time has the build already consumed while measuring this against the expected time. Use the email notification task to send out an email accordingly.
Here is an example that shows u how to get the last build details, http://blogs.microsoft.co.il/blogs/shair/archive/2011/01/11/tfs-api-part-33-get-build-definitions-and-build-details.aspx and here a custom task example http://msdn.microsoft.com/en-us/library/t9883dzc.aspx
Alternatively, query the TFS Build Queue and check the runtime of the builds in progress. When any of the builds exceeds the defined thresholds, send the email. This can be done in a windows service with relative ease.
You'd use the TFS Client Object Model to query the builds like this. Tarun already provided a nice link to that.

Resources