Difference between revisions of "Accounting Model"
Luca.frosini (Talk | contribs) (→StorageUsageRecord) |
Luca.frosini (Talk | contribs) (→TaskUsageRecord) |
||
Line 110: | Line 110: | ||
=== TaskUsageRecord === | === TaskUsageRecord === | ||
+ | Required fields: | ||
* '''jobId''' | * '''jobId''' | ||
* '''refHost''' | * '''refHost''' | ||
Line 116: | Line 117: | ||
* '''taskEndTime''' | * '''taskEndTime''' | ||
+ | The stored records will also contains a computed field: | ||
* '''wallDuration''' | * '''wallDuration''' | ||
+ | |||
+ | This field cannot be set manually (even with generic key-value setter method). It is always recalculated when '''taskStartTime''' and/or '''taskEndTime''' are set (The trigger is performed in any way this fields are set). Clearly the '''wallDuration''' can only be calculated only when both '''taskStartTime''' and '''taskEndTime''' are available. |
Revision as of 16:28, 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.
PortletUsageRecord
Required Fields
- portletId
- operationId
- message
ServiceUsageRecord
This records is automatically accounted by gcore and smartgears on service invocation. The service developers SHOULD not use it.
Required Fields:
- callerHost
- host
- serviceClass
- serviceName
- calledMethod
- duration
StorageUsageRecord
Required Field:
- resourceOwner
- resourceScope
- resourceURI
- providerURI
- operationType
- dataType
- dataVolume
TaskUsageRecord
Required fields:
- jobId
- refHost
- refVM
- taskStartTime
- taskEndTime
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 taskStartTime and/or taskEndTime are set (The trigger is performed in any way this fields are set). Clearly the wallDuration can only be calculated only when both taskStartTime and taskEndTime are available.