From 4b100be9a86256bee0787ec6c441820ec2305186 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Thu, 29 Dec 2022 19:33:29 -0500 Subject: [PATCH] Individual instance response times. --- app/VideoWeb/Invidious.class.st | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/VideoWeb/Invidious.class.st b/app/VideoWeb/Invidious.class.st index 9925cf7..b0a25b2 100644 --- a/app/VideoWeb/Invidious.class.st +++ b/app/VideoWeb/Invidious.class.st @@ -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