-
Notifications
You must be signed in to change notification settings - Fork 26.5k
[GSoC 2025] Add discovery-timeline QoS command to display real-time service discovery metadata #15590
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: 3.3
Are you sure you want to change the base?
Conversation
please take a look @AlbumenJ @songxiaosheng |
f6b621d
to
67ddb33
Compare
dubbo-plugin/dubbo-qos/pom.xml
Outdated
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.dubbo</groupId> | ||
<artifactId>dubbo-parent</artifactId> | ||
<version>${revision}</version> | ||
<version>3.3.6-SNAPSHOT</version> |
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.
use revision
dubbo-plugin/dubbo-qos/pom.xml
Outdated
@@ -34,6 +34,18 @@ | |||
<skip_maven_deploy>false</skip_maven_deploy> | |||
</properties> | |||
|
|||
<dependencyManagement> |
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.
You don't need to import it because it's already managed by the parent dependencyManagement.
use spotless format your code |
dubbo-plugin/dubbo-qos/pom.xml
Outdated
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>5.10.3</version> |
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.
All versions should be defined in dependencyManagement.
dubbo-plugin/dubbo-qos/pom.xml
Outdated
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> |
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.
Delete it because building configuration should be managed by dubbo-parent for building dubbo with different jdk versions.
dubbo-plugin/dubbo-qos/pom.xml
Outdated
@@ -89,7 +100,89 @@ | |||
<dependency> | |||
<groupId>org.apache.logging.log4j</groupId> | |||
<artifactId>log4j-slf4j-impl</artifactId> | |||
<version>2.24.3</version> |
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.
Delete all your added dependencies because these artifacts have already been added for testing.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15590 +/- ##
============================================
+ Coverage 61.02% 61.05% +0.03%
- Complexity 11500 11692 +192
============================================
Files 1909 1910 +1
Lines 86782 86984 +202
Branches 13094 13134 +40
============================================
+ Hits 52961 53111 +150
- Misses 28409 28441 +32
- Partials 5412 5432 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -0,0 +1,42 @@ | |||
online=org.apache.dubbo.qos.command.impl.Online |
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.
Delete this file because it has already existed in resources
|
||
RegistryManager registryManager = applicationModel.getBeanFactory().getBean(RegistryManager.class); | ||
if (registryManager == null) { | ||
logger.warn("RegistryManager not available"); |
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.
All warning or error log info should logged by ErrorTypeAwareLogger. e.g.,
- has exception
logger.warn(INTERNAL_ERROR, "some cause info", "", e.getMessage(), e);
- no exception
logger.warn(INTERNAL_ERROR, "", "", "warning messages");
INTERNAL_ERROR
should be selected from LoggerCodeConstants.
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.
updated by using ErrorTypeAwareLogger
@@ -88,6 +88,11 @@ | |||
<artifactId>log4j-slf4j-impl</artifactId> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> |
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.
Delete it because it already existed in this pom. you'd better install Maven Helper plugin if you use Intellij IDEA to ensure what artifacts have been defined in the pom.
added manually |
The cause is |
Mockito.when(serviceInstance.getMetadata()).thenReturn(metadata); | ||
|
||
String output = command.execute(new CommandContext("discovery-timeline"), null); | ||
System.out.println("testExecuteWithTimestamps Output:\n" + output); |
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.
Remove all System.out statements or log them refer to LsTest.java
Remove all System.out statements or log them refer to |
b1f64dd
to
6839f23
Compare
see the result: |
you'd better search some documents about how to solve git merge conflicts, |
@zrlw do any further modifications are required for this PR? |
waiting for other reviewers checking. |
thanks for clarification. |
Issue
#15212
Description
introduces a new command to the Dubbo QoS module: discovery-timeline. This command improves transparency into the service discovery process by listing active provider services along with their last known metadata update times and registry sources. It is designed to help developers and operators quickly inspect the current discovery state without diving deep into logs or complex diagnostics.
Benefits
Command Overview
Command:
discovery-timeline
Used Examples:
discovery-timeline discovery-timeline service=DemoService discovery-timeline registry=zookeeper://localhost:2181 discovery-timeline page=2 limit=5
Output Example
Tests Included
Verified On