Skip to content

Commit

Permalink
Add elapsed_time to session details (#1581)
Browse files Browse the repository at this point in the history
* Add elapsed_time to session details

* Add release note

* change to usage_time

* Docs build

* Update release note
  • Loading branch information
kt474 authored Apr 6, 2024
1 parent 84e2e19 commit d6c74f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions qiskit_ibm_runtime/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ def details(self) -> Optional[Dict[str, Any]]:
started_at: Timestamp of when the session was started.
closed_at: Timestamp of when the session was closed.
activated_at: Timestamp of when the session state was changed to active.
usage_time: The usage time, in seconds, of this Session or Batch.
Usage is defined as the time a quantum system is committed to complete a job.
"""
if self._session_id and isinstance(self._service, QiskitRuntimeService):
response = self._service._api_client.session_details(self._session_id)
Expand All @@ -303,6 +305,7 @@ def details(self) -> Optional[Dict[str, Any]]:
"started_at": response.get("started_at"),
"closed_at": response.get("closed_at"),
"activated_at": response.get("activated_at"),
"usage_time": response.get("elapsed_time"),
}
return None

Expand Down
3 changes: 3 additions & 0 deletions release-notes/unreleased/1567.feat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Session `details() <https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.Session#details>`__
now includes a new field, `usage_time`. Usage is defined as the time a quantum system
is committed to complete a job.

0 comments on commit d6c74f2

Please sign in to comment.