r1 - 10 Feb 2006 - 06:17:39 - TanDunlinYou are here: TWiki >  Main Web  >  ElixirReport > ElixirReportServerCookbook > JobInfo

IJobInfo Interface

IJobInfo - Provide Job Information on process on the Server

When rendering report or generating data, methods return an IJobInfo interface. You can extract related information about a particular job submitted to server.

example

import com.elixirtech.report2.runtime.IJobInfo;

...
public static DecimalFormat Decimal_Format;
static
{
    Decimal_Format = new DecimalFormat("###################0.000");
}
           
public void printReportGenerateJobInfo(IJobInfo myJob)
{
    SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd-Hmm");
    m_DateFormat = df.format(new Date());
       
    long timeRecieved = job.getLong(IJobInfo.JOB_RECEIVED);
    long timeStarted = job.getLong(IJobInfo.JOB_STARTED);
    long timeEnded = job.getLong(IJobInfo.JOB_ENDED);
    double totalQueueTime = (double) (timeStarted - timeRecieved) / 1000.0;
    double totalJobProcessTime = (double) (timeEnded - timeStarted) / 1000.0;
    double totalJobTime = (double) (timeEnded - timeRecieved) / 1000.0;
    int page = job.getInteger(IJobInfo.PAGE_COUNT);
    int recordcount = job.getInteger(IJobInfo.RECORD_COUNT);
    String mimeType = job.getString(IJobInfo.MIME_TYPE);
    double size = (double) job.getLong(IJobInfo.BYTE_SIZE) / 1000.0;

    String info = "total_thread ," + m_TotalThread + ", thread_id ,"
                + m_ThreadID + ", loop ," + loop + ", start ," + start
                + ", end " + end + ", client_time_taken(s) ,"
                + Decimal_Format.format(timeTaken)
                + ", job_time_queued(s) ,"
                + Decimal_Format.format(totalQueueTime)
                + ", job_time_process(s) ,"
                + Decimal_Format.format(totalJobProcessTime)
                + ", job_time_total(s) ,"
                + Decimal_Format.format(totalJobTime)
                + ", job_time_recieved(ms) ," + timeRecieved
                + ", job_time_started(ms) ," + timeStarted
                + ", job_time_ended(ms) ," + timeEnded
                + ", job_mime_type ," + mimeType + ", job_page ," + page
                + ", job_size(kb) ," + size
                + ", record_size ," + recordcount
                +", job_name ," + job.getString(IJobInfo.NAME)
                +", param_labels, "+m_ParamLabels;
    System.out.println(info);
}                   

Users of ERSClient 5.1.x or lesser API will have to migrate their code to his new interfaces.

-- TanDunlin - 10 Feb 2006

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback