diff --git a/CHANGELOG.MD b/CHANGELOG.MD new file mode 100644 index 0000000..e834bff --- /dev/null +++ b/CHANGELOG.MD @@ -0,0 +1,8 @@ +# Changelog + +## Unreleased + +### Added + +- Successful print message for each query will now also show the number of rows returned by the query. + diff --git a/query_performance_gauge.py b/query_performance_gauge.py index 702e8d0..cfa2d2f 100644 --- a/query_performance_gauge.py +++ b/query_performance_gauge.py @@ -59,6 +59,7 @@ def measure_query_runtime( cur = connection.cursor() cur.execute(query_to_measure.query_string) rows = cur.fetchall() + obtained_rows = len(rows) print( - f"Query '{query_to_measure.name}' took {int(time.time() - start_time)} seconds to run." + f"Query '{query_to_measure.name}' took {int(time.time() - start_time)} seconds to run and returned {obtained_rows} rows." )