Skip to content

Commit

Permalink
"completed" -> "succeeded" in PollerMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Dec 20, 2024
1 parent 78a7cbc commit 016fdbc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ trait PollerMetrics {
def totalOperationsSubmittedCount(): Long

/**
* The total number of I/O operations completed.
* The total number of I/O operations succeeded.
*/
def totalOperationsCompletedCount(): Long
def totalOperationsSucceededCount(): Long

/**
* The total number of I/O operations errored.
Expand All @@ -54,9 +54,9 @@ trait PollerMetrics {
def totalAcceptOperationsSubmittedCount(): Long

/**
* The total number of accept operations completed.
* The total number of accept operations succeeded.
*/
def totalAcceptOperationsCompletedCount(): Long
def totalAcceptOperationsSucceededCount(): Long

/**
* The total number of accept operations errored.
Expand All @@ -79,9 +79,9 @@ trait PollerMetrics {
def totalConnectOperationsSubmittedCount(): Long

/**
* The total number of connect operations completed.
* The total number of connect operations succeeded.
*/
def totalConnectOperationsCompletedCount(): Long
def totalConnectOperationsSucceededCount(): Long

/**
* The total number of connect operations errored.
Expand All @@ -104,9 +104,9 @@ trait PollerMetrics {
def totalReadOperationsSubmittedCount(): Long

/**
* The total number of read operations completed.
* The total number of read operations succeeded.
*/
def totalReadOperationsCompletedCount(): Long
def totalReadOperationsSucceededCount(): Long

/**
* The total number of read operations errored.
Expand All @@ -129,9 +129,9 @@ trait PollerMetrics {
def totalWriteOperationsSubmittedCount(): Long

/**
* The total number of write operations completed.
* The total number of write operations succeeded.
*/
def totalWriteOperationsCompletedCount(): Long
def totalWriteOperationsSucceededCount(): Long

/**
* The total number of write operations errored.
Expand All @@ -149,27 +149,27 @@ object PollerMetrics {
private[effect] object noop extends PollerMetrics {
def operationsOutstandingCount(): Int = 0
def totalOperationsSubmittedCount(): Long = 0
def totalOperationsCompletedCount(): Long = 0
def totalOperationsSucceededCount(): Long = 0
def totalOperationsErroredCount(): Long = 0
def totalOperationsCanceledCount(): Long = 0
def acceptOperationsOutstandingCount(): Int = 0
def totalAcceptOperationsSubmittedCount(): Long = 0
def totalAcceptOperationsCompletedCount(): Long = 0
def totalAcceptOperationsSucceededCount(): Long = 0
def totalAcceptOperationsErroredCount(): Long = 0
def totalAcceptOperationsCanceledCount(): Long = 0
def connectOperationsOutstandingCount(): Int = 0
def totalConnectOperationsSubmittedCount(): Long = 0
def totalConnectOperationsCompletedCount(): Long = 0
def totalConnectOperationsSucceededCount(): Long = 0
def totalConnectOperationsErroredCount(): Long = 0
def totalConnectOperationsCanceledCount(): Long = 0
def readOperationsOutstandingCount(): Int = 0
def totalReadOperationsSubmittedCount(): Long = 0
def totalReadOperationsCompletedCount(): Long = 0
def totalReadOperationsSucceededCount(): Long = 0
def totalReadOperationsErroredCount(): Long = 0
def totalReadOperationsCanceledCount(): Long = 0
def writeOperationsOutstandingCount(): Int = 0
def totalWriteOperationsSubmittedCount(): Long = 0
def totalWriteOperationsCompletedCount(): Long = 0
def totalWriteOperationsSucceededCount(): Long = 0
def totalWriteOperationsErroredCount(): Long = 0
def totalWriteOperationsCanceledCount(): Long = 0
}
Expand Down
34 changes: 17 additions & 17 deletions core/jvm/src/main/scala/cats/effect/unsafe/SelectorSystem.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class SelectorSystem private (provider: SelectorProvider) extends PollingS
if (cb != null) {
cb(value)
polled = true
if (error ne null) poller.countCompletedOperation(readyOps)
if (error ne null) poller.countSucceededOperation(readyOps)
else poller.countErroredOperation(node.interest)
} else {
poller.countCanceledOperation(node.interest)
Expand Down Expand Up @@ -167,11 +167,11 @@ final class SelectorSystem private (provider: SelectorProvider) extends PollingS
private[this] var submittedConnects: Long = 0
private[this] var submittedReads: Long = 0
private[this] var submittedWrites: Long = 0
private[this] var completedOperations: Long = 0
private[this] var completedAccepts: Long = 0
private[this] var completedConnects: Long = 0
private[this] var completedReads: Long = 0
private[this] var completedWrites: Long = 0
private[this] var succeededOperations: Long = 0
private[this] var succeededAccepts: Long = 0
private[this] var succeededConnects: Long = 0
private[this] var succeededReads: Long = 0
private[this] var succeededWrites: Long = 0
private[this] var erroredOperations: Long = 0
private[this] var erroredAccepts: Long = 0
private[this] var erroredConnects: Long = 0
Expand Down Expand Up @@ -204,24 +204,24 @@ final class SelectorSystem private (provider: SelectorProvider) extends PollingS
}
}

def countCompletedOperation(ops: Int): Unit = {
def countSucceededOperation(ops: Int): Unit = {
outstandingOperations -= 1
completedOperations += 1
succeededOperations += 1
if (isAccept(ops)) {
outstandingAccepts -= 1
completedAccepts += 1
succeededAccepts += 1
}
if (isConnect(ops)) {
outstandingConnects -= 1
completedConnects += 1
succeededConnects += 1
}
if (isRead(ops)) {
outstandingReads -= 1
completedReads += 1
succeededReads += 1
}
if (isWrite(ops)) {
outstandingWrites -= 1
completedWrites += 1
succeededWrites += 1
}
}

Expand Down Expand Up @@ -274,27 +274,27 @@ final class SelectorSystem private (provider: SelectorProvider) extends PollingS

def operationsOutstandingCount(): Int = outstandingOperations
def totalOperationsSubmittedCount(): Long = submittedOperations
def totalOperationsCompletedCount(): Long = completedOperations
def totalOperationsSucceededCount(): Long = succeededOperations
def totalOperationsErroredCount(): Long = erroredOperations
def totalOperationsCanceledCount(): Long = canceledOperations
def acceptOperationsOutstandingCount(): Int = outstandingAccepts
def totalAcceptOperationsSubmittedCount(): Long = submittedAccepts
def totalAcceptOperationsCompletedCount(): Long = completedAccepts
def totalAcceptOperationsSucceededCount(): Long = succeededAccepts
def totalAcceptOperationsErroredCount(): Long = erroredAccepts
def totalAcceptOperationsCanceledCount(): Long = canceledAccepts
def connectOperationsOutstandingCount(): Int = outstandingConnects
def totalConnectOperationsSubmittedCount(): Long = submittedConnects
def totalConnectOperationsCompletedCount(): Long = completedConnects
def totalConnectOperationsSucceededCount(): Long = succeededConnects
def totalConnectOperationsErroredCount(): Long = erroredConnects
def totalConnectOperationsCanceledCount(): Long = canceledConnects
def readOperationsOutstandingCount(): Int = outstandingReads
def totalReadOperationsSubmittedCount(): Long = submittedReads
def totalReadOperationsCompletedCount(): Long = completedReads
def totalReadOperationsSucceededCount(): Long = succeededReads
def totalReadOperationsErroredCount(): Long = erroredReads
def totalReadOperationsCanceledCount(): Long = canceledReads
def writeOperationsOutstandingCount(): Int = outstandingWrites
def totalWriteOperationsSubmittedCount(): Long = submittedWrites
def totalWriteOperationsCompletedCount(): Long = completedWrites
def totalWriteOperationsSucceededCount(): Long = succeededWrites
def totalWriteOperationsErroredCount(): Long = erroredWrites
def totalWriteOperationsCanceledCount(): Long = canceledWrites
}
Expand Down

0 comments on commit 016fdbc

Please sign in to comment.