-
Notifications
You must be signed in to change notification settings - Fork 521
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
feat(api&core): in oltp apis, add statistics info and support full info about vertices and edges #2262
Merged
Merged
feat(api&core): in oltp apis, add statistics info and support full info about vertices and edges #2262
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8a8f9c7
chore: improve gitignore file
DanGuge 8f3f9db
feat: add ApiMeasure to collect runtime data
DanGuge eef9da4
feat: Add ApiMeasure to JsonSerializer and Modify the Serializer inte…
DanGuge 023acf6
refactor: format code based on hugegraph-style.xml
DanGuge fc94aa3
feat: Add statistics information in all oltp restful apis response an…
DanGuge c6ab9f4
fix: numeric cast
DanGuge c7825a6
fix: Jaccard Similarity api test
DanGuge e671963
fix: adjust the code style and naming convention
DanGuge 1e33cda
Empty commit
DanGuge 262ae05
Empty commit
DanGuge 793ead8
fix:
DanGuge 5bb446a
fix: rollback change in .gitignore
DanGuge cea5db2
fix: rollback ServerOptions.java code style
DanGuge 4cc5f46
fix: rollback API.java code style and add exception in else branch
DanGuge 92ba7c8
fix: fix code style
DanGuge 559bff1
fix: name style & code style
DanGuge 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 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 |
---|---|---|
|
@@ -7,6 +7,8 @@ upload-files/ | |
demo* | ||
gen-java | ||
*.class | ||
swagger-ui-* | ||
hugegraph-dist/dist.sh | ||
|
||
### STS ### | ||
.apt_generated | ||
|
This file contains 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 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 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 |
---|---|---|
|
@@ -21,18 +21,6 @@ | |
import static org.apache.hugegraph.traversal.algorithm.HugeTraverser.DEFAULT_MAX_DEGREE; | ||
import static org.apache.hugegraph.traversal.algorithm.HugeTraverser.DEFAULT_PATHS_LIMIT; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.inject.Singleton; | ||
import jakarta.ws.rs.DefaultValue; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.Context; | ||
|
||
import org.slf4j.Logger; | ||
|
||
import org.apache.hugegraph.HugeGraph; | ||
import org.apache.hugegraph.api.API; | ||
import org.apache.hugegraph.api.graph.EdgeAPI; | ||
|
@@ -43,8 +31,20 @@ | |
import org.apache.hugegraph.traversal.algorithm.PathsTraverser; | ||
import org.apache.hugegraph.type.define.Directions; | ||
import org.apache.hugegraph.util.Log; | ||
import org.slf4j.Logger; | ||
|
||
import com.codahale.metrics.annotation.Timed; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.inject.Singleton; | ||
import jakarta.ws.rs.DefaultValue; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.Context; | ||
|
||
@Path("graphs/{graph}/traversers/crosspoints") | ||
@Singleton | ||
@Tag(name = "CrosspointsAPI") | ||
|
@@ -74,6 +74,7 @@ public String get(@Context GraphManager manager, | |
graph, source, target, direction, edgeLabel, | ||
depth, maxDegree, capacity, limit); | ||
|
||
ApiMeasure measure = new ApiMeasure(); | ||
Id sourceId = VertexAPI.checkAndParseVertexId(source); | ||
Id targetId = VertexAPI.checkAndParseVertexId(target); | ||
Directions dir = Directions.convert(EdgeAPI.parseDirection(direction)); | ||
|
@@ -84,6 +85,9 @@ public String get(@Context GraphManager manager, | |
dir, edgeLabel, depth, | ||
maxDegree, capacity, | ||
limit); | ||
return manager.serializer(g).writePaths("crosspoints", paths, true); | ||
measure.addIterCount(traverser.vertexIterCounter.get(), | ||
traverser.edgeIterCounter.get()); | ||
return manager.serializer(g, measure.getResult()) | ||
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. prefer to update the 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. Rejected:
|
||
.writePaths("crosspoints", paths, true); | ||
} | ||
} |
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.
Thanks, but we need fix/remove it in the
dist-script
rather than exclude them in git (will be fixed it in another PR) @VGalaxiesThere 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.
ok, fixed and rollback change