GridSafeDocumentation/ReportTemplates/Periods/

Periods

Typically, reports are run for a period of time. For example, a project report may show the usage of a project for the year so far. The time period used in report is defined as a Period.

The 'per' namespace needs to be defined in the Report, as follows:

<rep:Report 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:rep="http://safe.epcc.ed.ac.uk/report"
  xmlns:par="http://safe.epcc.ed.ac.uk/parameter"
  xmlns:per="http://safe.epcc.ed.ac.uk/period">

StartTime and EndTime

A period has a start and end time.

<per:Period>
        <per:StartTime>01-10-2008</per:StartTime>
        <per:EndTime>08-10-2008</per:EndTime>
</per:Period>

These time can be defined as

  • days, in the format "DD-MM-YYYY";
  • months, in the format "MM-YYYY"; or
  • timestamps, in the format "DD-MM-YYYY hh:mm:ss".

If no start time is specified then the default start time is specified which is the first day of the current month. If no end time is specified the first day of the next month used.

Note that if no time of day is specified it defaults to midnight at the start of that day so to select a full calandar month the end time should be the 1st day of the following month.

Number of Splits

A period can be split into sections, or splits. The number of splits in a period can be configured using the NumberOfSplits element. The example below show a how to define a period from the 26th of September 2008 to the 28th of Spetember 2008 and split into ten sections.

<per:Period>
        <per:StartTime>26-09-2008</per:StartTime>
        <per:EndTime>28-09-2008</per:EndTime>
        <per:NumberOfSplits>10</per:NumberOfSplits>
</per:Period>

SplitUnit and NumberOfSplitUnits

Instead of expressing an end time as a date, it may be preferable to specify that it should be 7 day after the start, ot 1 month after the start. This can be done using the SplitUnit and NumberOfSplitUnits and NumberOfSplits tags. The SplitUnit can be one of:

  • Second,
  • Minute,
  • Hour,
  • Day,
  • Week,
  • Month or
  • Year.

And the NumberOfSplitUnits is the number of these units in a split. The example below shows a year split into quarters, or four (NumberOfSplits) three (NumberOfSplitUnits) month (SplitUnit) splits.

<per:Period>
        <per:StartTime>09-2008</per:StartTime>
        <per:SplitUnit>Month</per:SplitUnit>
        <per:NumberOfSplitUnits>3</per:NumberOfSplitUnits>              
        <per:NumberOfSplits>4</per:NumberOfSplits>
</per:Period>

If either the NumberOfSplitUnits or the NumberOfSplits are not defined, they default to 1.

 

Grid-SAFE was funded by JISC and is maintained, developed, and managed by EPCC at the University of Edinburgh