Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 01_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def main():
This flow demonstrates how to map a task over a list of inputs.
It fetches a list of customer IDs and processes each one individually.
"""
# Start timer to measure total execution duration
start_time = time.perf_counter()

# Display the flow's purpose for a guided onboarding experience
Expand Down Expand Up @@ -69,6 +70,7 @@ def main():
# Explicitly wait for results to avoid AttributeErrors on futures
results = [f.result() for f in futures]

# Calculate duration
# Add visual breathing room before results
console.print()
duration = time.perf_counter() - start_time
Expand Down Expand Up @@ -104,6 +106,8 @@ def main():
)

console.print(Rule("Next Step", style="blue"))
console.print(
"➡️ Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!"
console.print(
"Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!"
console.print(
Expand Down
3 changes: 3 additions & 0 deletions 02_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def main():
- Use the Prefect logger for structured logging in tasks.
- Map tasks across a list of inputs.
"""
# Start timer to measure total execution duration
start_time = time.perf_counter()

# Display the flow's purpose for a guided onboarding experience
Expand Down Expand Up @@ -78,6 +79,7 @@ def main():
# Explicitly wait for results to avoid AttributeErrors on futures
results = [f.result() for f in futures]

# Calculate duration
# Add visual breathing room before results
console.print()
duration = time.perf_counter() - start_time
Expand Down Expand Up @@ -109,6 +111,7 @@ def main():

console.print(
Panel.fit(
f"[bold green]✨ Successfully processed {len(results)} customers with detailed logging in {duration:.2f}s![/bold green]",
f"[bold green]✨ Successfully processed {len(results)} customers in {duration:.2f}s![/bold green]",
title="Result",
border_style="green",
Expand Down
Loading