Skip to content

Commit 00a40fe

Browse files
committed
add profiling
1 parent 79ed1ba commit 00a40fe

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

orca/routes.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from orca.requester import fill_target_bounds, to_file
99
from orca.utils import get_filename_from_path
1010
import os
11+
import cProfile
1112

1213
data = Blueprint("data", __name__, url_prefix="/data")
1314

@@ -48,14 +49,9 @@ def orc_route():
4849
url = f"{thredds_base}{filepath}"
4950
to_file(url, outdir="", outfile=outpath.name, nc=False)
5051
else:
51-
orc(
52-
filepath,
53-
targets,
54-
thredds_base,
55-
threshold,
56-
outdir="",
57-
outfile=outpath.name,
58-
log_level=log_level,
52+
cProfile.run(
53+
'orc(filepath, targets, thredds_base, threshold, outdir="", outfile=outpath.name, log_level=log_level)',
54+
"profile.prof",
5955
)
6056

6157
resp = send_file(

0 commit comments

Comments
 (0)