develop to main#44
Merged
Merged
Conversation
Bot/サーバー単位 + 日次で読み上げ文字数とメッセージ数をDBに集計記録する。 SQLite/MySQL双方でアトミックUPSERTにより同時書き込みでもロストしない。 - 新規テーブル tts_count_data (bot_id, server_id, target_date 単位) - TTSCountRecorder で読み上げ確定時に非同期記録 - Micrometer Prometheus レジストリで /metrics エンドポイント公開 (デフォルト 127.0.0.1:9095, 設定で無効化可) - /stat コマンド (today/week/all/server) で Bot 所有者向けに集計表示 - 起動時に DB 累計値を Counter に注入し再起動後も整合
- server_id = 0 をBot全体合計の予約値とし、server_id IS NULLの分岐を削除
unique制約とON CONFLICT/ON DUPLICATE KEY UPDATE単一クエリに統一しrace conditionを解消
- /stat week でメッセージ数も表示
- TTSCountData#getRecord を追加し、StatCommand での2重SELECTを解消
- 起動時のCounter累計注入を削除 (Prometheusのrate計算を狂わせるため)
- MetricsRegistry の getOrCreate{Char,Message}Counter を共通化
- DataRepositoryImpl の sum 系ボイラープレートをwithConnectionヘルパで集約
- botId解決を getBot().getBotId() に統一
- RELATIVE_TIME_FORMAT を BaseCommand に集約
- PrometheusHttpExposer に固定スレッドプールを設定し詰まりを回避
- MetricsRegistryをinterface化しPrometheus実装とNoOp実装を分離 メトリクス無効時もnon-nullになり呼び出し側のnullチェックを削除 - ITTSRuntimeUseにgetTTSCountRecorder/getMetricsRegistryのdefaultを追加 VoiceAudioSchedulerのITTSRuntime.getInstance()プルを既存パターンに統一 - ITTSRuntime#initMetricsを生成と起動に限定し、シャットダウンフック登録を registerShutdownHooksに分離
集計機能のマージ後に別PRで対応する方針のため、 Prometheus関連の実装を本PRから取り除く - core/metrics配下を削除 - MetricsConfigを削除 - ITTSRuntime/Use・Config・selfhost ConfigImplから参照を除去 - Micrometer依存を削除 - TTSCountRecorderはDB書き込みのみに簡略化
- core.statistics パッケージを新設し、TTSCount 関連を集約 - statistics.enable / statistics.data_base コンフィグを追加 - 保存先を save_data.db から statistics_data.db (または独立MySQLスキーマ) に分離 - 集計粒度にボイス別 (voice_type / voice_category) を追加 - 本体 DAO/Repository から TTSCount 関連を全削除
実行構成からローカル依存のJRE指定を削除
合成に失敗したテキストが再起動まで無音になる問題を修正する。 - 例外完了したFutureをlocalCachesから除去し再合成を可能にする - 空音声をキャッシュせず例外として扱う - ロード失敗時にuseLockを解放しタイムアウト破棄を機能させる - グローバルキャッシュのlock/unlockをtry/finallyで確実化 - LocalCache.disposeの削除判定の逆ロジックを修正 - キャッシュ破棄時の例外を握りつぶさずログ出力する
振る舞いは変えずに内部構造を整理する。 - createLocalCacheをcreateViaGlobalCache/createViaLocalSourceに分割 - 空音声チェックをEMPTY_AUDIO_MESSAGE定数とvalidateNonEmptyに集約 - CachedVoiceTrackLoaderのloadTackをloadTrackに改名
決定論的だったローカルキャッシュファイルパスを世代番号付きにし、disposeのdeleteが新世代のファイルを削除する競合を防止。あわせてグローバルキャッシュのヒット経路でも空データ検証を行うよう修正し、パス構築をstaticメソッドへ切り出して副作用なしでテスト可能にした。
音声合成失敗時のキャッシュ汚染を修正
voice_type_keyテーブルをvoice_typeへ改名しカテゴリIDを保持させ、 tts_count_dataからvoice_category_idを削除
…-type 統計のボイスカテゴリをボイステーブルで紐づけるよう修正
Member
Author
|
@copilot |
Contributor
チェンジログを追記しました (コミット: チェンジログにUnreleasedエントリを追記)。
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.