Skip to content

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.

Resource usage contains the following information:

AttributeTypeDescription

project_oid*

strThe ObjectId of the corresponding PERSEUS project

compute_project_id*

strThe identifier of the corresponding compute project

resource_id*

str

The identifier of the corresponding resource (has to be identical with the Resource.id property within PERSEUS)

start*

str

An ISO-formatted datetime string indicating when the usage time frame starts

end*

str

An ISO-formatted datetime string indicating when the usage time frame ends

value*

int | float

The total usage amount (use absolute amount; use the resource manager to configure units)

contingent_factorint | 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)

userstr

The user who produced the usage (to benefit from all features, the username should be a property known to PERSEUS by the Person.username property)

partitionstrThe partition the usage was produced on
prioritystr

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_metricslist[dict]

Additional metrics associated with this usage that do not relate to a resource known to PERSEUS (see additional metrics for further information)

additional_resourceslist[dict]

Additional metrics associated with this usage that relate to a resource known to PERSEUS (see additional resources for further information)

additional_datadict[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.

An additional metric contains the following information:

AttributeTypeDescription

metric_id*

strThe identifier of the metric

value*

int | floatThe total usage amount
contingent_factorint | 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)

An additional resource contains the following information:

AttributeTypeDescription

resource_id*

str

The identifier of the corresponding resource (has to be identical with the Resource.id property within PERSEUS)

value*

int | floatThe total usage amount
contingent_factorint | 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)