Skip to content

Commit

Permalink
Merge branch 'develop' into wx_927_requester_pays
Browse files Browse the repository at this point in the history
  • Loading branch information
mcovarr committed Sep 6, 2024
2 parents 212be25 + c557bfd commit ca8654c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ gha-creds-*.json

# jenv
.java-version

# metals
.metals/
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ object CallMetadataKeys {
val BackendLabels = "backendLabels"
val Labels = "labels"
val CommandLine = "commandLine"
val VmCostUsd = "vmCostUsd"
val TaskStartTime = "taskStartTime"
val TaskEndTime = "taskEndTime"
val VmCostPerHour =
"vmCostPerHour" // for a given task attempt, how much does it cost per hour. Currently assumed to be USD.
val VmStartTime = "vmStartTime" // time that the user VM starts spending money in a given task attempt.
val VmEndTime = "vmEndTime" // time that the user VM stops spending money in a given task attempt.

object CallCachingKeys {
val EffectiveModeKey = CallCaching + MetadataKey.KeySeparator + "effectiveCallCachingMode"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ object TesAsyncBackendJobExecutionActor {
tesVmCostData match {
case Some(v) =>
val state = t.state
v.startTime.foreach(s => tellMetadataFn(Map(CallMetadataKeys.TaskStartTime -> s)))
v.vmCost.foreach(v => tellMetadataFn(Map(CallMetadataKeys.VmCostUsd -> v)))
v.startTime.foreach(s => tellMetadataFn(Map(CallMetadataKeys.VmStartTime -> s)))
v.vmCost.foreach(v => tellMetadataFn(Map(CallMetadataKeys.VmCostPerHour -> v)))
getTesStatusFn(state, tesVmCostData, handle.pendingJob.jobId)
case None =>
getTesStatusFn(t.state, tesVmCostData, handle.pendingJob.jobId)
Expand Down Expand Up @@ -345,7 +345,7 @@ object TesAsyncBackendJobExecutionActor {

taskEndTime.onComplete {
case Success(result) =>
result.foreach(r => tellMetadataFn(Map(CallMetadataKeys.TaskEndTime -> r)))
result.foreach(r => tellMetadataFn(Map(CallMetadataKeys.VmEndTime -> r)))
val newCostData = runStatus.costData.map(_.copy(endTime = result))
runStatus match {
case _: Complete => tellBardFn(Complete(newCostData))
Expand Down

0 comments on commit ca8654c

Please sign in to comment.