Skip to content

Commit 199b8ae

Browse files
committed
Revert "Fix perceivedLatency to set it for only 1 trigger per display session (aws#5118)"
This reverts commit 364305e.
1 parent 91d5a0c commit 199b8ae

File tree

1 file changed

+1
-13
lines changed
  • plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials

1 file changed

+1
-13
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials/CodeWhispererClientAdaptor.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,6 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
304304
val programmingLanguage = fileContext.programmingLanguage
305305
var e2eLatency = sessionContext.latencyContext.getCodeWhispererEndToEndLatency()
306306

307-
// service side will only aggregate perceivedLatency with non-zero value
308-
// For client-side, if the decision is not accept and reject, we will set the value to 0
309-
// If the decision is accept or reject, it's guaranteed that they will need a perceivedLatency
310-
// of non-zero because for accept case it's trivial, for reject case, this trigger must be the
311-
// first seen trigger and this is the only one reject in this display session.
312-
val emittedPerceivedLatency =
313-
if (suggestionState == CodewhispererSuggestionState.Accept || suggestionState == CodewhispererSuggestionState.Reject) {
314-
sessionContext.latencyContext.perceivedLatency
315-
} else {
316-
0.0
317-
}
318-
319307
// When we send a userTriggerDecision of Empty or Discard, we set the time users see the first
320308
// suggestion to be now.
321309
if (e2eLatency < 0) {
@@ -332,7 +320,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
332320
it.sessionId(responseContext.sessionId)
333321
it.recommendationLatencyMilliseconds(e2eLatency)
334322
it.triggerToResponseLatencyMilliseconds(sessionContext.latencyContext.paginationFirstCompletionTime)
335-
it.perceivedLatencyMilliseconds(emittedPerceivedLatency)
323+
it.perceivedLatencyMilliseconds(sessionContext.latencyContext.perceivedLatency)
336324
it.suggestionState(suggestionState.toCodeWhispererSdkType())
337325
it.timestamp(Instant.now())
338326
it.suggestionReferenceCount(suggestionReferenceCount)

0 commit comments

Comments
 (0)