class documentation
Protocol describing operation-level progress tracking.
This protocol mirrors the server-side ProgressTracker object and adds convenience helpers for time and work fractions.
The tracker is only available for v1 operations that include a
progress_tracker field. For v1alpha1 operations,
Operation.progress_tracker returns None.
Example
Reading overall progress:
tracker = operation.progress_tracker()
if tracker:
print(tracker.description())
work_fraction = tracker.work_fraction()
if work_fraction is not None:
print(f"Work: {work_fraction:.0%}")
time_fraction = tracker.time_fraction()
if time_fraction is not None:
print(f"Time: {time_fraction:.0%}")
| Method | description |
Return a human-readable description of the tracker. |
| Method | estimated |
Return the estimated completion timestamp when available. |
| Method | finished |
Return the tracker finished timestamp or None if unfinished. |
| Method | started |
Return the tracker start timestamp or None if unknown. |
| Method | steps |
Return steps reported by the progress tracker. |
| Method | time |
Return elapsed time fraction or None when unavailable. |
| Method | work |
Return work progress details for the tracker when available. |
| Method | work |
Return the completed work fraction or None when unavailable. |