Difference between revisions of "Accounting Model"
Luca.frosini (Talk | contribs) (→Aggregated Usage Record) |
Luca.frosini (Talk | contribs) (→JobUsageRecord) |
||
Line 63: | Line 63: | ||
=== JobUsageRecord === | === JobUsageRecord === | ||
+ | Required Fields | ||
+ | * '''jobId''' | ||
+ | * '''jobQualifier''' | ||
+ | * '''jobName''' | ||
+ | * '''jobStartTime''' | ||
+ | * '''jobEndTime''' | ||
+ | * '''vmsUsed''' | ||
+ | The stored records will also contains a computed field: | ||
+ | * '''wallDuration''' | ||
+ | |||
+ | This field cannot be set manually (even with generic key-value setter method). It is always recalculated when '''jobStartTime''' and/or '''jobEndTime''' are set (The trigger is performed in any way this fields are set). Clearly the '''wallDuration''' can only be calculated only when both '''jobStartTime''' and '''jobEndTime''' are available. | ||
=== PortletUsageRecord === | === PortletUsageRecord === |
Revision as of 12:39, 1 December 2015
The Accounting Model is based on the concept of Usage Record (UR).
Contents
Accounting Usage Records Hierarchy
Interfaces
Abstract Implementation
Interfaces
Usage Record
This is the very basic interface to respect for every Usage Record. It mainly define the generic access methods. In particular:
- Getter and Setter for basic fields;
- Generic Key-Value method both to set and retrieve a single value (key:String, value:Comparable<? extends Serializable>);
- Generic Map<String, Comparable<? extends Serializable>> to set all property at once.
Single Usage Record
Used to identify if an UsageRecord is referred to a single operation to account.
Common SingleUsageRecord fields:
- id
- consumerId
- creationTime
- scope
- operationResult
Fields derived from UsageRecord implementation type (internal use only):
- usageRecordType
Aggregated Usage Record
Used to identify if an UsageRecord is referred to the aggregation of one (degenerate case) or more UsageRecords becoming from different accounting operations.
This interface define additional methods which allow to retry information regarding
- how many SingleUsageRecords were aggregated
- the time interval related to the aggregated SingleUsageRecords
Common AggregatedUsageRecord fields:
- startTime
- endTime
- aggregated
- operationCount
Abstract Implementation
Basic Usage Record
This is an abstract class which implements the UsageRecord interface and moreover contains basic functionality to reduce the amount of time and lines of code to create a new type of Usage Records. It uses extensively decorators and
Even if is not strictly mandatory, the developers is strongly encouraged to inherits from this base class to create a new UsageRecord, so that he/she can take advance of validations and harmonization facility provided.
Usage Records Standard Types
JobUsageRecord
Required Fields
- jobId
- jobQualifier
- jobName
- jobStartTime
- jobEndTime
- vmsUsed
The stored records will also contains a computed field:
- wallDuration
This field cannot be set manually (even with generic key-value setter method). It is always recalculated when jobStartTime and/or jobEndTime are set (The trigger is performed in any way this fields are set). Clearly the wallDuration can only be calculated only when both jobStartTime and jobEndTime are available.