4.4.6.
jobUsage Wrapper Script
Up one level
Language
Like all other application wrapper scripts, jobUsage can be written in any scripting language supported by the host OS.
- For Linux, the first line of the script (eg.
#!/usr/bin/python) is used to determine which interpreter to use. The filename extension can be anything (eg. jobUsage.py, jobUsage.sh). - On Windows, the filename extension is used to determine which interpreter to use. Currently only Python (.py) and Perl (.pl) are recognised.
Application Wrapper Functionality
The jobUsage application wrapper script is an optional script that generates usage reports, indicating how much resource a job for a specific application is using. The GRIA Job Service runs this script occasionally during the job's execution, and once when the job has completed, to gather usage reports. It combines these reports with the ones from the resource manager and then forwards them to the SLA service.
When is jobUsage run?
The jobUsage script is run approximately twice per minute during the job's execution, and then once again immediately after the job finishes. The exact frequency of the calls to jobUsage depends on service load, but is guaranteed to be at most once per 30 seconds.
Output format
The jobUsage script should print on stdout an XML fragment similar to the following:
<UsageReport metric="http://example.com/metrics/example1" type="instantaneous" time="2008-06-27T06:26:48">562</UsageReport> <UsageReport metric="http://example.com/metrics/example2" type="cumulative" startTime="2008-06-27T06:26:44" endTime="2008-06-27T06:26:48">21</UsageReport> <UsageReport metric="http://example.com/metrics/example3" type="instantaneous" time="2008-06-27T06:26:48" >75.32</UsageReport>
Each usage report contains the following components:
- Metric - identifies the metric for which usage is being reported. The metric URI should be unique. For example, the resource manager plugins use the following metric URI for reporting CPU usage:
http://www.gria.org/sla/metric/resource/cpu
- Type - either instantaneous or cumulative. Instantaneous reports describe the usage now, and should be reset to 0 when the job has finished. Cumulative reports describe the total usage over the entire duration of the job's execution.
- Value - the numeric value of the usage report. The type of this is double.
- Time - time in ISO 8601 format 'yyyy-MM-ddTHH:mm:ss' for instanteneous metrics.
- StartTime - start time in ISO 8601 format 'yyyy-MM-ddTHH:mm:ss' for cumulative metrics.
- EndTime - end time in ISO 8601 format 'yyyy-MM-ddTHH:mm:ss' for cumulative metrics.
