-
Notifications
You must be signed in to change notification settings - Fork 53
[feat]Add metrics to prometheus-grafana dashboard and logs #493
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
base: develop
Are you sure you want to change the base?
Conversation
b4370e7 to
4f80c77
Compare
| def build_kv_connector_stats( | ||
| cls, data: dict[str, Any] | None = None | ||
| ) -> Optional[KVConnectorStats]: | ||
| return UCMDirectConnector.build_kv_connector_stats(data) |
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.
Must we use specific class here?
| self.data[worker_rank][metric_name] = [] | ||
| self.data[worker_rank][metric_name].extend(values) | ||
| else: | ||
| # Other is a different type, treat as single worker "0" |
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.
Will there be other connector's stats aggregate with UCMKVConnectorStats?
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.
fixed
|
|
||
| def observe( | ||
| self, | ||
| transfer_stats_data: dict[str, Any] | KVConnectorStats, |
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.
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.
fixed
test/common/uc_eval/utils/metric.py
Outdated
| self, | ||
| expected_output: Union[str, List[str], tuple[str]], | ||
| real_output: str, | ||
| **kwargs |
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.
No need to add this comma
| for worker_data in self.data.values() | ||
| ) | ||
|
|
||
| def aggregate(self, other: KVConnectorStats) -> KVConnectorStats: |
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.
The excessive nesting depth (five levels) can be simplified by extracting helper functions and streamlining conditional checks. Same as function reduce
5406e4d to
83741d3
Compare

Purpose
Add the metrics display function to ucm_connector. You can specify which metrics to display on prometheus-grafana by configuring the metrics_configs.yaml file, and these metrics will also be output to the logs.
Modifications
Add three interfaces get_kv_connector_stats, build_kv_connector_stats and build_prom_metrics, as well as two classes UCMKVConnectorStats and UCMPromMetrics to ucm_connector.
Test
prometheus-grafana display


log display