summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc
diff options
context:
space:
mode:
authormjkwiatkowski <mati.rewa@gmail.com>2026-06-19 10:57:10 +0200
committermjkwiatkowski <mati.rewa@gmail.com>2026-06-19 10:57:10 +0200
commitca0c72789ba87791829001d259000b2966d9d6e4 (patch)
tree8e488741389a24acc30d02b742398935586c54c9 /opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc
parent54f94861da743cbd72d9755c2fbe4223176d90f4 (diff)
feat: added additional capability to HTTPClientHEADmaster
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt
index 7a540e86..cda4bec1 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt
@@ -1,6 +1,7 @@
package org.opendc.compute.simulator.scheduler
+import org.opendc.common.utils.HTTPClient
import org.opendc.compute.simulator.scheduler.filters.HostFilter
import org.opendc.compute.simulator.service.HostView
import org.opendc.compute.simulator.service.ServiceTask
@@ -22,7 +23,7 @@ public class SmartScheduler : ComputeScheduler {
private val hostsQueue = List(100, { mutableListOf<HostView>() })
private var minAvailableHost = 0
private var numHosts = 0
-
+ private val client = HTTPClient.getInstance()
// Unlucky Hosts for WhatsApp
//private var unluckyHosts = listOf("H01","H02-109","H02-229","H02-107","H02-227","H02-105","H02-226","H02-103","H02-101","H02-222","H02-221","H02-220","H02-213","H02-212","H02-210","H02-208","H02-207","H02-206","H02-204","H02-203","H02-202","H01-181","H01-184","H01-185","H01-186","H01-189","H01-170","H01-174","H01-175","H01-178","H01-179","H01-169","H01-164","H01-166","H01-167","H01-168","H02-197","H02-196","H02-195","H02-194","H01-270","H02-193","H01-271","H02-192","H01-152","H02-190","H01-275","H01-155","H01-157"," H01-91"," H01-94"," H01-84"," H02-52"," H02-54"," H01-87"," H02-55"," H01-88"," H01-89"," H02-57"," H02-58"," H02-59"," H02-70"," H01-95"," H02-63"," H01-96"," H02-64"," H02-65"," H01-98"," H02-66"," H01-99"," H02-67"," H02-69"," H02-83"," H02-74"," H02-76"," H02-78"," H02-90"," H02-91","H01-192","H01-193","H01-195"," H02-87"," H02-89","H01-103","H01-224","H01-105","H01-226","H01-106","H01-227","H01-228"," H01-50","H02-148","H02-147"," H01-48"," H02-16"," H02-17","H02-144","H02-265"," H02-18","H02-264","H02-141","H02-262","H02-140","H02-261","H02-260"," H01-42"," H02-10"," H01-43"," H02-12"," H01-45","H01-221"," H02-13"," H01-46","H01-101","H01-222"," H01-47","H01-102","H01-223"," H02-15","H01-213","H01-214","H01-215","H01-218","H01-219","H02-139","H02-138","H02-135","H02-256"," H01-59"," H02-27","H02-134","H02-133","H02-254","H02-253","H02-130","H02-250"," H01-53"," H02-21"," H01-54"," H02-22"," H01-55"," H01-56","H01-210","H01-211"," H02-25","H01-202","H01-203","H01-204","H01-206"," H01-70","H01-207"," H01-72","H01-209","H02-129","H02-248","H02-126","H02-246","H02-245"," H02-38","H02-122","H02-121","H02-242","H02-241"," H01-62"," H02-30"," H01-64"," H01-65"," H01-66"," H02-35","H01-200"," H02-36","H01-201"," H02-0"," H02-1"," H01-80"," H02-50"," H01-83"," H02-51","H02-118","H02-239","H02-117","H02-238","H02-237","H02-115","H02-113"," H02-49","H02-112","H02-233","H02-111","H02-231"," H02-41"," H01-75"," H02-43"," H02-9"," H02-4"," H02-45"," H02-46"," H01-79","H01-147","H01-268","H01-149","H02-189","H02-186","H02-185","H02-184","H02-183","H02-182","H01-260","H01-140","H02-180","H01-141","H01-262","H01-263","H01-264","H01-144","H01-145","H01-146","H01-267","H01-136","H01-257"," H01-3"," H01-2"," H01-17","H02-176","H02-175","H02-173","H02-172"," H01-9","H02-170"," H01-8","H01-250","H01-130","H01-251","H01-252"," H01-5"," H01-11"," H01-12"," H01-13"," H01-6","H01-135","H01-246","H01-126","H01-127","H01-129","H02-169"," H01-27","H02-165","H02-162","H02-161","H02-160","H01-240","H01-122"," H01-24","H01-124","H01-114","H01-236","H01-117","H01-238","H01-239","H01-119","H02-158","H02-157"," H01-39","H02-275","H02-274","H02-151","H02-150","H02-270"," H01-31"," H01-33","H01-110"," H01-34","H01-111","H01-232","H01-233"," H01-36","H01-113")
@@ -31,7 +32,7 @@ public class SmartScheduler : ComputeScheduler {
//private var unluckyHosts = listOf("H01-44","H01-66","H01-73","H01-74","H01-85","H01-86","H01-89","H01-10","H01-98","H01-13","H01-39")
// Unlucky Hosts for Twitter
- //private var unluckyHosts = listOf("H01-180","H01-181","H01-182","H01-184","H01-185","H01-186","H01-188","H01-171","H01-173","H01-176","H01-177","H01-178","H01-179","H01-169"," H01","H01-162","H01-163","H01-164","H01-165","H01-166","H01-168","H01-158","H01-270","H01-150","H01-271","H01-272","H01-273","H01-274","H01-154","H01-155","H01-156","H01-157"," H01-90"," H01-91"," H01-92"," H01-93"," H01-88"," H01-89"," H01-95"," H01-96"," H01-99","H01-190","H01-191","H01-192","H01-193","H01-196","H01-197","H01-198","H01-103","H01-224","H01-225","H01-106","H01-228","H01-108"," H01-50"," H01-40"," H01-42"," H01-43"," H01-44"," H01-45","H01-100","H01-222","H01-102","H01-223","H01-214","H01-215","H01-216","H01-217","H01-218"," H01-60"," H01-59"," H01-51"," H01-52"," H01-53"," H01-56","H01-210"," H01-57","H01-211","H01-212","H01-202","H01-204","H01-205","H01-206"," H01-70"," H01-71"," H01-72","H01-209"," H01-63"," H01-64"," H01-80"," H01-82"," H01-73"," H01-76"," H01-77","H01-268","H01-269","H01-149","H01-260","H01-140","H01-262","H01-263","H01-143","H01-144","H01-265","H01-145","H01-146","H01-267"," H01-1","H01-136","H01-257","H01-137","H01-258"," H01-3","H01-139"," H01-17"," H01-18"," H01-9"," H01-8","H01-130","H01-251","H01-252"," H01-4"," H01-12","H01-133","H01-254"," H01-7"," H01-14","H01-135","H01-256","H01-126"," H01-26"," H01-27"," H01-28"," H01-29"," H01-20","H01-120","H01-241"," H01-22","H01-242","H01-243"," H01-24","H01-123"," H01-25","H01-124","H01-115","H01-116","H01-237","H01-117","H01-118","H01-239"," H01-38"," H01-31","H01-230"," H01-33","H01-110"," H01-35","H01-233","H01-113")
+ //private var unluckyHosts = listOf("H01-180","H01-181","H01-182","H01-184","H01-185","H01-186","H01-188","H01-171","H01-173","H01-176","H01-177","H01-178","H01-179","H01-169","H01","H01-162","H01-163","H01-164","H01-165","H01-166","H01-168","H01-158","H01-270","H01-150","H01-271","H01-272","H01-273","H01-274","H01-154","H01-155","H01-156","H01-157"," H01-90"," H01-91"," H01-92"," H01-93"," H01-88"," H01-89"," H01-95"," H01-96"," H01-99","H01-190","H01-191","H01-192","H01-193","H01-196","H01-197","H01-198","H01-103","H01-224","H01-225","H01-106","H01-228","H01-108"," H01-50"," H01-40"," H01-42"," H01-43"," H01-44"," H01-45","H01-100","H01-222","H01-102","H01-223","H01-214","H01-215","H01-216","H01-217","H01-218"," H01-60"," H01-59"," H01-51"," H01-52"," H01-53"," H01-56","H01-210"," H01-57","H01-211","H01-212","H01-202","H01-204","H01-205","H01-206"," H01-70"," H01-71"," H01-72","H01-209"," H01-63"," H01-64"," H01-80"," H01-82"," H01-73"," H01-76"," H01-77","H01-268","H01-269","H01-149","H01-260","H01-140","H01-262","H01-263","H01-143","H01-144","H01-265","H01-145","H01-146","H01-267"," H01-1","H01-136","H01-257","H01-137","H01-258"," H01-3","H01-139"," H01-17"," H01-18"," H01-9"," H01-8","H01-130","H01-251","H01-252"," H01-4"," H01-12","H01-133","H01-254"," H01-7"," H01-14","H01-135","H01-256","H01-126"," H01-26"," H01-27"," H01-28"," H01-29"," H01-20","H01-120","H01-241"," H01-22","H01-242","H01-243"," H01-24","H01-123"," H01-25","H01-124","H01-115","H01-116","H01-237","H01-117","H01-118","H01-239"," H01-38"," H01-31","H01-230"," H01-33","H01-110"," H01-35","H01-233","H01-113")
override fun addHost(host: HostView) {
// We do not want a host available if it is in the list of unluckyHosts
@@ -77,6 +78,8 @@ public class SmartScheduler : ComputeScheduler {
}
override fun select(iter: MutableIterator<SchedulingRequest>): SchedulingResult {
+ client?.checkForInsights()
+
if (numHosts == 0) {
return SchedulingResult(SchedulingResultType.FAILURE)
}