Individual instance response times.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-12-29 19:33:29 -05:00
parent 4b6ad35ed6
commit 4b100be9a8
1 changed files with 11 additions and 7 deletions

View File

@ -51,13 +51,8 @@ Invidious class >> rawInstances [
Invidious class >> responseTimes [
| responses |
responses := Dictionary new.
self instancesWithAPIEnabled do: [ :instance | | runTime|
runTime := [ ZnClient new
beOneShot;
url: instance uri;
get;
response ] timeToRun.
responses at: instance put: runTime.
self instancesWithAPIEnabled do: [ :instance |
responses at: instance put: instance responseTime.
].
^ (responses associations asSortedCollection: [ :x :y| x value < y value ])
collect: [:assoc | assoc ]
@ -116,6 +111,15 @@ Invidious >> region: countryISOCode [
region := countryISOCode
]
{ #category : #accessing }
Invidious >> responseTime [
^ [ ZnClient new
beOneShot;
url: self uri;
get;
response ] timeToRun
]
{ #category : #accessing }
Invidious >> uri [
^ uri