diff --git a/01_getting_started.py b/01_getting_started.py index 5b7d7d7..862f738 100644 --- a/01_getting_started.py +++ b/01_getting_started.py @@ -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 @@ -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 @@ -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( diff --git a/02_logging.py b/02_logging.py index 39d33c1..6d82c23 100644 --- a/02_logging.py +++ b/02_logging.py @@ -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 @@ -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 @@ -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",