AJ Floersch

12/07/2022, 1:27 PM
Hey, everyone! The below screenshot is from the Dagit UI section of the docs and shows an awesome view of Asset Details (particularly the Materializations over Time and Execution Time sections). However, after scouring the rest of the docs and the UI itself, I'm struggling to find how I can implement this view on my own assets. I'm starting to wonder if this is maybe an outdated screenshot, and these types of charts/details are meant to be replaced with Asset Plots? If so, any guidance on best practice for recreating the Execution Time charts would be greatly appreciated. For reference, I am currently running version 1.0.17 Thank you!


12/07/2022, 4:59 PM
hi @AJ Floersch! The
Execution time
there is actually a piece of metadata that's attached to the asset materialization event (and parsed directly out of the dbt response in this case). You can add that metadata to your own assets doing something like :
def foo(context):
    start_time = time.time()
    # do stuff...
    context.add_output_metadata({"Execution time": time.time() - start_time})
    return result
We're also looking into surfacing this information automatically (rather than making you manually calculate the execution time)

AJ Floersch

12/07/2022, 5:26 PM
Gotcha - that makes sense! Thank you, sir! Appreciate the code snippet to help steer me in the right direction.