naver / arcus-java-client

ARCUS Java client
Apache License 2.0
50 stars 47 forks source link

writeQ 크기와 readQ 크기의 계산 오류. #591

Closed jhpark816 closed 1 year ago

jhpark816 commented 1 year ago

현재 queue 크기 계산 코드는 다음과 같다.

  public int getWriteQueueSize() {
    return writeQ.size();
  }

  public int getReadQueueSize() {
    return readQ.size();
  }

  @Override
  public String getStatus() {
    return "#Tops=" + addOpCount +
        " #iq=" + getInputQueueSize() +
        " #Wops=" + getWriteQueueSize() +
        " #Rops=" + getReadQueueSize() +
        " #CT=" + getContinuousTimeout() +
        " #TD=" + getTimeoutDuration() +
        " #TR=" + getTimeoutRatioNow();
  }

  public final String toString() {
    int sops = 0;
    if (getSk() != null && getSk().isValid()) {
      sops = getSk().interestOps();
    }
    int rsize = readQ.size() + (optimizedOp == null ? 0 : 1);
    int wsize = writeQ.size();
    int isize = inputQueue.size();
    . . .
  }

문제가 되는 부분은

uhm0311 commented 1 year ago

~https://github.com/naver/arcus-java-client/pull/590~ (실수로 다른 PR을 가져옴)

https://github.com/naver/arcus-java-client/pull/588

위 PR에 같이 반영하도록 할까요?

jhpark816 commented 1 year ago

따로 PR 받을게요.

https://github.com/naver/arcus-java-client/pull/588 은 별도로 논의해야 할 것 같습니다.

jhpark816 commented 1 year ago

@uhm0311 optmizedOp가 writeQ 크기에 반영되어야 하는 것이 맞죠 ?

uhm0311 commented 1 year ago

@jhpark816

네 그런 것 같습니다.

uhm0311 commented 1 year ago

https://github.com/naver/arcus-java-client/pull/595

위 PR로 merge 되었습니다.