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

View File

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