Report resource usage
To transfer resource usages to PERSEUS, you can use the usage reporting API. This way, you can see usage related data for a compute project within the project details view. Additionally, in case you use Andromeda, you allow your users to see their resource usages as well.
You can report resource usage using the endpoint /service/UsageReporting/{project_oid}.
If you want to update already transferred data, simply transfer the updated content.
PERSEUS will check if an entry exists that has
- the same
project_oid - the same
compute_project_id - the same
resource_id - the same
start - the same
end - the same
user - the same
partition - and the same
priority.
If all of these attributes are the same, PERSEUS considers it a match. If a match is found, it will overwrite the existing usage reporting instead of creating a new one.
Attributes
Section titled “Attributes”Resource usage contains the following information:
| Attribute | Type | Description |
|---|---|---|
| str | The ObjectId of the corresponding PERSEUS project |
| str | The identifier of the corresponding compute project |
| str | The identifier of the corresponding resource (has to be
identical with the |
| str | An ISO-formatted datetime string indicating when the usage time frame starts |
| str | An ISO-formatted datetime string indicating when the usage time frame ends |
| int | float | The total usage amount (use absolute amount; use the resource manager to configure units) |
contingent_factor | int | float | How much the usage should weigh for contingent consumption (defaults to 1; if 0 is given, the usage will appear in usage graphs but is not used for calculating the used contingent) |
user | str | The user who produced the usage (to benefit from all features,
the username should be a property known to PERSEUS by the
|
partition | str | The partition the usage was produced on |
priority | str | The priority used when producing the usage (to benefit from all features, the priority should be a priority identifier set via the priority manager) |
additional_metrics | list[dict] | Additional metrics associated with this usage that do not relate to a resource known to PERSEUS (see additional metrics for further information) |
additional_resources | list[dict] | Additional metrics associated with this usage that relate to a resource known to PERSEUS (see additional resources for further information) |
additional_data | dict[str, Any] | Any data you want to save together with this usage reporting, for example further statistics |
Please see Services - UsageReporting in the API documentation for details on the related data models.
Additional metrics
Section titled “Additional metrics”An additional metric contains the following information:
| Attribute | Type | Description |
|---|---|---|
| str | The identifier of the metric |
| int | float | The total usage amount |
contingent_factor | int | float | How much the usage should weigh for contingent consumption (defaults to 1; if 0 is given, the usage will appear in usage graphs but is not used for calculating the used contingent) |
Additional resources
Section titled “Additional resources”An additional resource contains the following information:
| Attribute | Type | Description |
|---|---|---|
| str | The identifier of the corresponding resource (has to be
identical with the |
| int | float | The total usage amount |
contingent_factor | int | float | How much the usage should weigh for contingent consumption (defaults to 1; if 0 is given, the usage will appear in usage graphs but is not used for calculating the used contingent) |