Hello! I want to track my dbt models execution tim...
# community-support
a
Hello! I want to track my dbt models execution time, to find out if a model is suddenly taking longer time and so costs more. it doesn’t have to be an increase in volume, but even changes to the model’s sql that can cause that. I was thinking of using an anomaly detection test on the
elementary.dbt_run_results
table, but I need a test that will check the average execution time for every model, which I don’t think is available. any chance you have a solution or a recommendation how to approach this?
d
Hey @Anat Ezra, have you tried to use
where_expression
with this test ?
Though the metric you probably want to test is not something we support, cause our volume anomalies test counts rows
a
it’s more of a
column_anomalies
test of type average, combined with the
dimension_anomalies
tests, in the sense of a dimension split. I thought about using
columns_anomalies
with
where_expression
, which will require a test for every model value, which is not ideal
d
oh ya, columns_anomalies will work 🙂
and yes, it will require
where_expression
per model you want to check
a
do you happen to know if I can use a for loop to overcome this? I know jinja is limited in yaml files in dbt
d
you want to loop over all available models ?
a
theoretically (I will probably want to limit this to a reasonable list of models)