Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kotlinx.serialization.json.JsonPrimitive
data class RuntimeContext(
val name: String = "",
val numUsers: Int = 0,
val numUsersActive: Int = 0,
val numTasks: Int = 0,
val numThreads: Int = 0,
val userParams: Map<String, JsonPrimitive> = mapOf(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data class TestProfile(
//
// This value represents the "L" in Little's Law (equation)
//
val numUsersActive: Int = 0,
val numTasks: Int = 0,

// List of percentile values to report on.
val percentiles: List<Double> = listOf(50.0, 75.0, 90.0, 95.0, 99.0),
Expand Down
24 changes: 12 additions & 12 deletions tulip-runtime/src/main/kotlin/io/github/wfouche/tulip/core/Tulip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private val g_tests = mutableListOf<TestProfile>()
data class ConfigContext(
val enabled: Boolean = false,
@SerialName("num_users") val numUsers: Int = 0,
@SerialName("num_users_active") val numUsersActive: Int = USER_THREAD_QSIZE,
@SerialName("num_tasks") val numTasks: Int = USER_THREAD_QSIZE,
@SerialName("num_threads") val numThreads: Int = 0,
@SerialName("user_params") val userParams: Map<String, JsonPrimitive> = mapOf(),
)
Expand All @@ -229,7 +229,7 @@ data class ConfigTest(
@SerialName("aps_rate") val throughputRate: Double = 0.0,
@SerialName("aps_rate_step_change") val throughputRateStepChange: Double = 0.0,
@SerialName("aps_rate_step_count") val throughputRateStepCount: Int = 1,
@SerialName("num_users_active") val numUsersActive: Int = 0,
@SerialName("num_tasks") val numTasks: Int = 0,
@SerialName("scenario_actions") val actions: List<ConfigAction> = listOf(),
@SerialName("scenario_workflow") val workflow: String = "",
)
Expand Down Expand Up @@ -301,7 +301,7 @@ fun initConfig(text: String): String {
// println("${k}")
val e = entry.value
if (e.enabled) {
val v = RuntimeContext(k, e.numUsers, e.numUsersActive, e.numThreads, e.userParams)
val v = RuntimeContext(k, e.numUsers, e.numTasks, e.numThreads, e.userParams)
g_contexts.add(v)
}
}
Expand All @@ -323,7 +323,7 @@ fun initConfig(text: String): String {
arrivalRate = e.throughputRate,
arrivalRateStepChange = e.throughputRateStepChange,
arrivalRateStepCount = e.throughputRateStepCount,
numUsersActive = e.numUsersActive,
numTasks = e.numTasks,
actions =
mutableListOf<Action>().apply {
if (e.workflow.isEmpty()) {
Expand Down Expand Up @@ -393,17 +393,17 @@ val wthread_wait_stats = Histogram(histogramNumberOfSignificantValueDigits)
/*-------------------------------------------------------------------------*/

private fun getQueueLengths(context: RuntimeContext, test: TestProfile): Int {
return if (test.numUsersActive != 0) {
test.numUsersActive
return if (test.numTasks != 0) {
test.numTasks
} else {
context.numUsersActive
context.numTasks
}
}

/*-------------------------------------------------------------------------*/

private fun getTest(context: RuntimeContext, test: TestProfile): TestProfile {
return test.copy(numUsersActive = getQueueLengths(context, test))
return test.copy(numTasks = getQueueLengths(context, test))
}

/*-------------------------------------------------------------------------*/
Expand Down Expand Up @@ -613,7 +613,7 @@ private fun runTest(testCase: TestProfile, contextId: Int, indexTestCase: Int, q
var numActions: Long = 0
var apsRate: Double = 0.0
if (arrivalRate > -1.0) {
// Pre-Warmup duration at max speed, ungoverned.
// Pre-Warmup duration at max speed, ungov
nanosPerAction = 0.0
numActionsMax = 0
} else {
Expand Down Expand Up @@ -757,7 +757,7 @@ private fun runTulip(
Console.put("======================================================================")
Console.put("")
Console.put(" NUM_USERS = $MAX_NUM_USERS")
Console.put(" NUM_USERS_ACTIVE = ${context.numUsersActive}")
Console.put(" NUM_TASKS = ${context.numTasks}")
if (MAX_NUM_THREADS == 0) {
MAX_NUM_THREADS = MAX_NUM_USERS
Console.put(" NUM_VIRTUAL_THREADS = $MAX_NUM_THREADS")
Expand All @@ -778,9 +778,9 @@ private fun runTulip(
} else {
g_workflow = workflows[x.workflow]
}
val numUsersActive = x.numUsersActive
val numTasks = x.numTasks
// Thread.sleep(5000)
runTest(x, contextId, indexTestCase, numUsersActive)
runTest(x, contextId, indexTestCase, numTasks)
g_workflow = null
}
}
Expand Down