-
Notifications
You must be signed in to change notification settings - Fork 0
stats 로깅 시스템 & 대시보드 api 추가 #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kimgh06
wants to merge
12
commits into
develop
Choose a base branch
from
feature/stats-dashboard
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9f74d7c
Merge pull request #88 from gamultong/develop
byundojin 8f880a5
chore: add server dev and deploy port helpers
kak06-thebldgs 957b065
feat: add stats logging and dashboard api
kak06-thebldgs ff9cc02
fix: tolerate locked database during log flush
kak06-thebldgs 233d76a
refactor: align stats logging with server conventions
kak06-thebldgs ee69566
feat: add stats logging dashboard api
kak06-thebldgs 27806f2
Merge remote-tracking branch 'origin/develop' into feature/stats-dash…
kak06-thebldgs 269cf31
refactor: move log storage out of board module
kak06-thebldgs 7f87161
fix: align stats logging with backend conventions
kak06-thebldgs 9e2eede
fix: limit port check to runtime make targets
kak06-thebldgs 7f97c59
fix: align stats persistence with backend conventions
kak06-thebldgs f71b265
fix: reduce logging and stats dynamic types
kak06-thebldgs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,3 +29,4 @@ build/ | |
| # 로컬 도구 바이너리 (Makefile 참고) | ||
| bin/ | ||
| .env.grafana-mcp | ||
| .omc/ | ||
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Callable | ||
|
|
||
| from .lifecycle import LifeCycle | ||
|
|
||
| LifecycleSink = Callable[[LifeCycle], None] | ||
|
|
||
|
|
||
| class LifecycleSinkRegistry: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 용도 뭐임? |
||
| def __init__(self) -> None: | ||
| self._sinks: list[LifecycleSink] = [] | ||
|
|
||
| def add(self, sink: LifecycleSink) -> LifecycleSink: | ||
| if sink not in self._sinks: | ||
| self._sinks.append(sink) | ||
| return sink | ||
|
|
||
| def remove(self, sink: LifecycleSink) -> None: | ||
| if sink in self._sinks: | ||
| self._sinks.remove(sink) | ||
|
|
||
| def emit(self, lifecycle: LifeCycle) -> None: | ||
| for sink in list(self._sinks): | ||
| sink(lifecycle) | ||
|
|
||
|
|
||
| _sink_registry = LifecycleSinkRegistry() | ||
|
|
||
|
|
||
| def add_lifecycle_sink(sink: LifecycleSink) -> LifecycleSink: | ||
| return _sink_registry.add(sink) | ||
|
|
||
|
|
||
| def remove_lifecycle_sink(sink: LifecycleSink) -> None: | ||
| _sink_registry.remove(sink) | ||
|
|
||
|
|
||
| def emit_lifecycle(lifecycle: LifeCycle) -> None: | ||
| _sink_registry.emit(lifecycle) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| """lifecycle sink 테스트""" | ||
|
|
||
| from core.lifecycle import LifeCycle | ||
| from core.lifecycle.internal.sink import LifecycleSinkRegistry | ||
|
|
||
|
|
||
| class TestLifecycleSinkRegistry: | ||
| def test_add_ignores_duplicate_sink(self) -> None: | ||
| registry = LifecycleSinkRegistry() | ||
| lifecycle = LifeCycle.create() | ||
| emitted: list[str] = [] | ||
|
|
||
| def sink(lifecycle: LifeCycle) -> None: | ||
| emitted.append(lifecycle.id) | ||
|
|
||
| registry.add(sink) | ||
| registry.add(sink) | ||
|
|
||
| registry.emit(lifecycle) | ||
|
|
||
| assert emitted == [lifecycle.id] | ||
|
|
||
| def test_remove_sink(self) -> None: | ||
| registry = LifecycleSinkRegistry() | ||
| lifecycle = LifeCycle.create() | ||
| emitted: list[str] = [] | ||
|
|
||
| def sink(lifecycle: LifeCycle) -> None: | ||
| emitted.append(lifecycle.id) | ||
|
|
||
| registry.add(sink) | ||
| registry.remove(sink) | ||
|
|
||
| registry.emit(lifecycle) | ||
|
|
||
| assert emitted == [] |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
브로커에 기능 추가되면 반드시 합리적인 이유 필요함