Skip to content

Commit

Permalink
hotfix api profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
voynow committed Nov 8, 2024
1 parent a2c9fb8 commit 9258fe8
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 87 deletions.
4 changes: 3 additions & 1 deletion mobile/mobile/APIManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Foundation
class APIManager {
static let shared = APIManager()
private init() {
// Configure session for connection reuse
let config = URLSessionConfiguration.default
config.timeoutIntervalForRequest = 30
config.timeoutIntervalForResource = 300
Expand Down Expand Up @@ -38,9 +37,12 @@ class APIManager {
func fetchTrainingWeekData(
token: String, completion: @escaping (Result<TrainingWeekData, Error>) -> Void
) {
let startTime = CFAbsoluteTimeGetCurrent()
let body: [String: Any] = ["jwt_token": token, "method": "get_training_week"]

performRequest(body: body, responseType: TrainingWeekResponse.self) { result in
let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime
print("fetchTrainingWeekData took \(timeElapsed) seconds")
switch result {
case .success(let response):
if response.success, let trainingWeekString = response.trainingWeek,
Expand Down
98 changes: 44 additions & 54 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
aiohappyeyeballs==2.4.0 ; python_version >= "3.10" and python_version < "4.0"
aiohttp==3.10.5 ; python_version >= "3.10" and python_version < "4.0"
aiohappyeyeballs==2.4.3 ; python_version >= "3.10" and python_version < "4.0"
aiohttp==3.10.10 ; python_version >= "3.10" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
anyio==4.6.0 ; python_version >= "3.10" and python_version < "4.0"
appdirs==1.4.4 ; python_version >= "3.10" and python_version < "4.0"
anyio==4.6.2.post1 ; python_version >= "3.10" and python_version < "4.0"
arrow==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
async-timeout==4.0.3 ; python_version >= "3.10" and python_version < "3.11"
attrs==24.2.0 ; python_version >= "3.10" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.17.1 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy"
charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0"
charset-normalizer==3.4.0 ; python_version >= "3.10" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
cryptography==43.0.3 ; python_version >= "3.10" and python_version < "4.0"
deprecation==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
distro==1.9.0 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11"
flexcache==0.3 ; python_version >= "3.10" and python_version < "4.0"
flexparser==0.3.1 ; python_version >= "3.10" and python_version < "4.0"
frozenlist==1.4.1 ; python_version >= "3.10" and python_version < "4.0"
gotrue==2.8.1 ; python_version >= "3.10" and python_version < "4.0"
flexparser==0.4 ; python_version >= "3.10" and python_version < "4.0"
frozenlist==1.5.0 ; python_version >= "3.10" and python_version < "4.0"
gotrue==2.10.0 ; python_version >= "3.10" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
h2==4.1.0 ; python_version >= "3.10" and python_version < "4.0"
hpack==4.0.0 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.5 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.6 ; python_version >= "3.10" and python_version < "4.0"
httpx==0.27.2 ; python_version >= "3.10" and python_version < "4.0"
httpx[http2]==0.27.2 ; python_version >= "3.10" and python_version < "4.0"
hyperframe==6.0.1 ; python_version >= "3.10" and python_version < "4.0"
idna==3.10 ; python_version >= "3.10" and python_version < "4.0"
jinja2==3.1.4 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "4.0"
multidict==6.1.0 ; python_version >= "3.10" and python_version < "4.0"
openai==1.39.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.10" and python_version < "4.0"
pint==0.24.3 ; python_version >= "3.10" and python_version < "4.0"
polars==0.20.31 ; python_version >= "3.10" and python_version < "4.0"
packaging==24.2 ; python_version >= "3.10" and python_version < "4.0"
pint==0.24.4 ; python_version >= "3.10" and python_version < "4.0"
platformdirs==4.3.6 ; python_version >= "3.10" and python_version < "4.0"
postgrest==0.16.11 ; python_version >= "3.10" and python_version < "4.0"
propcache==0.2.0 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy"
pydantic==1.10.16 ; python_version >= "3.10" and python_version < "4.0"
pyjwt==2.9.0 ; python_version >= "3.10" and python_version < "4.0"
pyperclip==1.9.0 ; python_version >= "3.10" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.10" and python_version < "4.0"
pytz==2024.2 ; python_version >= "3.10" and python_version < "4.0"
realtime==2.0.2 ; python_version >= "3.10" and python_version < "4.0"
realtime==2.0.6 ; python_version >= "3.10" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.10" and python_version < "4.0"
sib-api-v3-sdk==7.6.0 ; python_version >= "3.10" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
storage3==0.7.7 ; python_version >= "3.10" and python_version < "4.0"
storage3==0.8.2 ; python_version >= "3.10" and python_version < "4.0"
stravalib==1.7 ; python_version >= "3.10" and python_version < "4.0"
strenum==0.4.15 ; python_version >= "3.10" and python_version < "4.0"
supabase==2.7.4 ; python_version >= "3.10" and python_version < "4.0"
supafunc==0.5.1 ; python_version >= "3.10" and python_version < "4.0"
tqdm==4.66.5 ; python_version >= "3.10" and python_version < "4.0"
types-python-dateutil==2.9.0.20240906 ; python_version >= "3.10" and python_version < "4.0"
supabase==2.8.0 ; python_version >= "3.10" and python_version < "4.0"
supafunc==0.6.2 ; python_version >= "3.10" and python_version < "4.0"
tqdm==4.67.0 ; python_version >= "3.10" and python_version < "4.0"
types-python-dateutil==2.9.0.20241003 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.10" and python_version < "4.0"
websockets==12.0 ; python_version >= "3.10" and python_version < "4.0"
yarl==1.11.1 ; python_version >= "3.10" and python_version < "4.0"
websockets==13.1 ; python_version >= "3.10" and python_version < "4.0"
yarl==1.17.1 ; python_version >= "3.10" and python_version < "4.0"
Loading

0 comments on commit 9258fe8

Please sign in to comment.