Skip to content

fix: 미상 건수를 유료 요청에서 세고 모델 행을 가격으로 가른다 - #116

Merged
yessjun merged 1 commit into
mainfrom
fix/unpriced-count-excludes-self-hosted
Sep 7, 2026
Merged

fix: 미상 건수를 유료 요청에서 세고 모델 행을 가격으로 가른다#116
yessjun merged 1 commit into
mainfrom
fix/unpriced-count-excludes-self-hosted

Conversation

@yessjun

@yessjun yessjun commented Sep 7, 2026

Copy link
Copy Markdown
Member

📝 작업내용

  • 소비처와 호출 종류 행에 creditAxisRequests 추가. 금액이 빠진 건수를 전체 요청이 아니라 유료 요청에서 빼게 함
  • 모델 행에 가격이 붙은 입력 토큰과 출력 토큰, 응답 시간 합, 실패 수 추가(V113이 만드는 컬럼 넷)
  • 모델 행의 평균 응답을 서버가 가격 기준으로 갈라서 두 값으로 내려보냄. 한 값을 두 행에 되풀이하면 서로 다른 요청 수를 갖고도 같은 응답 시간을 말하게 됨
  • 관리자 키 사용량 조회도 같은 스키마를 쓰므로 원본 이벤트에서 유료 축을 세도록 채움
  • 요약 층 pricedRequests 설명 정정. 「totalRequests와 견주면」이 자체 서빙 비중을 함께 담는 비율이라 견주지 말라고 다시 씀
  • API 명세 v0.68.0. 연산 수 변화 없음

⭐️ 검증

  • mvn clean verify 1321건 통과, 실패와 오류 0. 마이그레이션을 편집했으므로 clean으로 판정
  • 변이 넷을 각각 독립으로 적용해 빨강 확인. 소비처 질의의 유료 축 합을 전체 요청으로, 모델 질의의 가격 붙은 입력 토큰을 전체 입력 토큰으로, 그리고 콘솔 쪽 둘
  • 적대 검토가 「초록일 것」이라 예측한 자리는 초록을 보는 대신 픽스처를 구별 가능하게 고쳤다. 유료 모델의 요청과 유료 축이 둘 다 2라 두 분모가 같은 값이었고 입출력 토큰이 둘 다 1이라 맞바꿔도 안 보였음. 한도 거부를 더해 요청 3과 유료 축 2로 가르고 토큰을 7과 3으로 비대칭화
  • 관리자 키 사용량 조회의 creditAxisRequests에 단언 추가. 그 조회를 덮는 시험 클래스가 하나뿐인 것을 먼저 세어 확인
  • 라이브 실측 둘. cost_usd가 있으면서 성공이 아닌 행이 0건, swept_before가 null

💬 리뷰 포인트

  • 모델 표만 가격 기준으로 자르고 나머지 둘은 축 기준으로 세는 것. 모델 행의 두 부분은 그 모델의 요청을 남김없이 갈라야 해서 축으로 자를 수 없다고 봤다. 축으로 자르면 자체 서빙과 한도 거부가 어느 행에도 안 들어가 두 행의 합이 모델 요청 수와 달라진다. 세 표가 한 화면에서 다른 규칙을 쓰는 대가가 있다
  • priced_failed를 컬럼으로 둔 것. 「금액이 붙은 요청은 언제나 성공」은 라이브에서 0건으로 확인되지만 게이트웨이 동작이지 이 스키마의 보증이 아니라, 가정 대신 세기로 했다. 컬럼 하나를 아끼고 화면에 상수 0을 두는 갈래도 성립한다
  • CHECK 제약 셋이 구 jar를 막지 못한다. 구 jar의 insert는 새 컬럼을 명명하지 않아 default 0이 들어가고 제약이 전부 참이다. 막을 방법을 두지 않고 주석과 배포 절차로 넘겼다

The screen said "N requests with an unknown amount" and reached that N by
subtracting the priced count from every request in the row. A self-hosted
request has no amount at all rather than an unknown one, and a refusal never
reached a provider, so the number counted both as something we had failed to
learn. That is the error a card-level sentence was removed for, done again
once per row.

Rows that fold several models together now carry the paid-axis count and
subtract from that. The model table does not: its two parts have to cover the
model's requests without a remainder, so it splits on price and the screen
draws the model as two whole rows, one with the amount and one without, each
with its own tokens, latency and failure rate. Priced token and latency sums
and a priced failure count travel with the row so neither row has to assume
what the other holds.

Rolled-up days keep zeros in the new columns until the watermark is reset,
which the migration comment says how and when to do, along with what an
automatic rollback to an older jar does to them.
@yessjun
yessjun merged commit 636d04c into main Sep 7, 2026
1 check passed
@yessjun
yessjun deleted the fix/unpriced-count-excludes-self-hosted branch September 7, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant