Skip to content
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 16 commits into from
Aug 19, 2023

Conversation

DanGuge
Copy link
Contributor

@DanGuge DanGuge commented Jul 28, 2023

Purpose of the PR

  • Add statistics infomation in oltp api response, including the number of vertices and edges traversed at runtime, as well as the time the api takes to execute
  • Support full infomation about vertices and edges in oltp api response

Main Changes

Statistics information:

  • add vertexIterCounter and edgeIterCounter in HugeTraverser.java to track traversed vertices and edges at run time

  • modify all oltp apis to add statistics information in response

  • modify Serializer.java and JsonSerializer.java to support statistics infomation serialization

  • design document

Full information about vertices and edges:

  • add 'with_vertex' and 'with_edge' parameter option in oltp apis

  • modify oltp apis to support vertex and edge information in api response

  • add EdgeRecord in HugeTraverser.java to record edges at run time and generate the edge information returned in api response

  • modify Path and PathSet in HugeTraverser.java to support full edge information storage

  • modify all traversers to support track of edge information at run time

  • modify Serializer.java and JsonSerializer.java to support full infomation serialization about vertices and edges

  • design document

Implementation overview

  • N: No Need

  • ✓: Supported

statistics with_vertex with_edge
Kout Get N N
Kout Post
Kneighbor Get N N
Kneighbor Post
Sameneighbors Get N N
Sameneighbors Post N
Jaccard Similarity Get N N
Jaccard Similarity Post N N
Shortest Path Get
All Shortest Paths Get
Weighted Shortest Path Get
Single Source Shortest Path Get
Multi Node Shortest Path Post
Paths Get N N
Paths Post
Customized Paths Post
Template Paths Post
Crosspoints Get N N
Customized Crosspoints Post
Rings Get
Rays Get
Fusiform Similarity Post N N

measure full-info

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • Postman Test: the tests of Kout Post and Single Source Shortest Path Get are shown below

Initialize the Graph

  • Initialze the graph according to the link

Kout Post

  • Method & Url
POST http://localhost:8080/graphs/{graph}/traversers/kout

with_vertex=false, with_edge=false

  • Request Body
{
  "source": "1:marko",
  "step": {
    "direction": "BOTH",
    "labels": ["knows", "created"],
    "properties": {
      "weight": "P.gt(0.1)"
    },
    "max_degree": 10000,
    "skip_degree": 100000
  },
  "max_depth": 1,
  "nearest": true,
  "limit": 10000,
  "with_vertex": false,
  "with_path": true,
  "with_edge": false
}
  • Response Status
200
  • Response Body
{
    "kout": [
        "1:vadas",
        "1:josh",
        "2:lop"
    ],
    "size": 3,
    "paths": [
        {
            "objects": [
                "1:marko",
                "2:lop"
            ]
        },
        {
            "objects": [
                "1:marko",
                "1:josh"
            ]
        },
        {
            "objects": [
                "1:marko",
                "1:vadas"
            ]
        }
    ],
    "vertices": [
        "1:marko",
        "1:josh",
        "1:vadas",
        "2:lop"
    ],
    "edges": [
        "S1:marko>1>20160110>S1:vadas",
        "S1:marko>2>>S2:lop",
        "S1:marko>1>20130220>S1:josh"
    ],
    "measure": {
        "edge_iterations": 3,
        "vertice_iterations": 1,
        "cost": 72
    }
}
image

with_vertex=true, with_edge=true

  • Request Body
{
  "source": "1:marko",
  "step": {
    "direction": "BOTH",
    "labels": ["knows", "created"],
    "properties": {
      "weight": "P.gt(0.1)"
    },
    "max_degree": 10000,
    "skip_degree": 100000
  },
  "max_depth": 1,
  "nearest": true,
  "limit": 10000,
  "with_vertex": true,
  "with_path": true,
  "with_edge": true
}
  • Response Status
200
  • Response Body
{
    "kneighbor": [
        "1:vadas",
        "1:josh",
        "2:lop",
        "1:peter",
        "2:ripple"
    ],
    "size": 5,
    "paths": [
        {
            "objects": [
                "1:marko",
                "2:lop"
            ]
        },
        {
            "objects": [
                "1:marko",
                "2:lop",
                "1:peter"
            ]
        },
        {
            "objects": [
                "1:marko",
                "1:josh"
            ]
        },
        {
            "objects": [
                "1:marko",
                "1:vadas"
            ]
        },
        {
            "objects": [
                "1:marko",
                "1:josh",
                "2:ripple"
            ]
        }
    ],
    "vertices": [
        {
            "id": "2:ripple",
            "label": "software",
            "type": "vertex",
            "properties": {
                "name": "ripple",
                "lang": "java",
                "price": 199
            }
        },
        {
            "id": "1:marko",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "marko",
                "age": 29,
                "city": "Beijing"
            }
        },
        {
            "id": "1:josh",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "josh",
                "age": 32,
                "city": "Beijing"
            }
        },
        {
            "id": "1:vadas",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "vadas",
                "age": 27,
                "city": "Hongkong"
            }
        },
        {
            "id": "1:peter",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "peter",
                "age": 35,
                "city": "Shanghai"
            }
        },
        {
            "id": "2:lop",
            "label": "software",
            "type": "vertex",
            "properties": {
                "name": "lop",
                "lang": "java",
                "price": 328
            }
        }
    ],
    "edges": [
        {
            "id": "S1:josh>2>>S2:ripple",
            "label": "created",
            "type": "edge",
            "outV": "1:josh",
            "outVLabel": "person",
            "inV": "2:ripple",
            "inVLabel": "software",
            "properties": {
                "weight": 1.0,
                "date": "20171210"
            }
        },
        {
            "id": "S1:marko>1>20160110>S1:vadas",
            "label": "knows",
            "type": "edge",
            "outV": "1:marko",
            "outVLabel": "person",
            "inV": "1:vadas",
            "inVLabel": "person",
            "properties": {
                "weight": 0.5,
                "date": "20160110"
            }
        },
        {
            "id": "S1:marko>2>>S2:lop",
            "label": "created",
            "type": "edge",
            "outV": "1:marko",
            "outVLabel": "person",
            "inV": "2:lop",
            "inVLabel": "software",
            "properties": {
                "weight": 0.4,
                "date": "20171210"
            }
        },
        {
            "id": "S1:marko>1>20130220>S1:josh",
            "label": "knows",
            "type": "edge",
            "outV": "1:marko",
            "outVLabel": "person",
            "inV": "1:josh",
            "inVLabel": "person",
            "properties": {
                "weight": 1.0,
                "date": "20130220"
            }
        },
        {
            "id": "S1:peter>2>>S2:lop",
            "label": "created",
            "type": "edge",
            "outV": "1:peter",
            "outVLabel": "person",
            "inV": "2:lop",
            "inVLabel": "software",
            "properties": {
                "weight": 0.2,
                "date": "20170324"
            }
        }
    ],
    "measure": {
        "edge_iterations": 12,
        "vertice_iterations": 12,
        "cost": 34
    }
}
image

Single Source Shortest Path Get

  • Method & Url
http://localhost:8080/graphs/hugegraph/traversers/singlesourceshortestpath?source="1:marko"&with_vertex=false&with_edge=false&weight=weight
  • Response Status
200
  • Response Body
{
    "paths": {
        "1:peter": {
            "weight": 0.6000000000000001,
            "vertices": [
                "1:marko",
                "2:lop",
                "1:peter"
            ]
        },
        "2:lop": {
            "weight": 0.4,
            "vertices": [
                "1:marko",
                "2:lop"
            ]
        },
        "1:josh": {
            "weight": 0.8,
            "vertices": [
                "1:marko",
                "2:lop",
                "1:josh"
            ]
        },
        "2:ripple": {
            "weight": 1.8,
            "vertices": [
                "1:marko",
                "2:lop",
                "1:josh",
                "2:ripple"
            ]
        },
        "1:vadas": {
            "weight": 0.5,
            "vertices": [
                "1:marko",
                "1:vadas"
            ]
        }
    },
    "vertices": [
        "1:peter",
        "2:lop",
        "1:josh",
        "2:ripple",
        "1:marko",
        "1:vadas"
    ],
    "edges": [
        "S1:josh>2>>S2:ripple",
        "S1:marko>1>20160110>S1:vadas",
        "S1:josh>2>>S2:lop",
        "S1:marko>2>>S2:lop",
        "S1:peter>2>>S2:lop"
    ],
    "measure": {
        "edge_iterations": 12,
        "vertice_iterations": 6,
        "cost": 16
    }
}
image
  • Method & Url
http://localhost:8080/graphs/hugegraph/traversers/singlesourceshortestpath?source="1:marko"&with_vertex=true&with_edge=true&weight=weight
  • Response Status
200
  • Response Body
{
    "paths": {
        "1:peter": {
            "weight": 0.6000000000000001,
            "vertices": [
                "1:marko",
                "2:lop",
                "1:peter"
            ]
        },
        "2:lop": {
            "weight": 0.4,
            "vertices": [
                "1:marko",
                "2:lop"
            ]
        },
        "1:josh": {
            "weight": 0.8,
            "vertices": [
                "1:marko",
                "2:lop",
                "1:josh"
            ]
        },
        "2:ripple": {
            "weight": 1.8,
            "vertices": [
                "1:marko",
                "2:lop",
                "1:josh",
                "2:ripple"
            ]
        },
        "1:vadas": {
            "weight": 0.5,
            "vertices": [
                "1:marko",
                "1:vadas"
            ]
        }
    },
    "vertices": [
        {
            "id": "1:peter",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "peter",
                "age": 35,
                "city": "Shanghai"
            }
        },
        {
            "id": "2:lop",
            "label": "software",
            "type": "vertex",
            "properties": {
                "name": "lop",
                "lang": "java",
                "price": 328
            }
        },
        {
            "id": "1:josh",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "josh",
                "age": 32,
                "city": "Beijing"
            }
        },
        {
            "id": "2:ripple",
            "label": "software",
            "type": "vertex",
            "properties": {
                "name": "ripple",
                "lang": "java",
                "price": 199
            }
        },
        {
            "id": "1:marko",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "marko",
                "age": 29,
                "city": "Beijing"
            }
        },
        {
            "id": "1:vadas",
            "label": "person",
            "type": "vertex",
            "properties": {
                "name": "vadas",
                "age": 27,
                "city": "Hongkong"
            }
        }
    ],
    "edges": [
        {
            "id": "S1:josh>2>>S2:ripple",
            "label": "created",
            "type": "edge",
            "outV": "1:josh",
            "outVLabel": "person",
            "inV": "2:ripple",
            "inVLabel": "software",
            "properties": {
                "weight": 1.0,
                "date": "20171210"
            }
        },
        {
            "id": "S1:marko>1>20160110>S1:vadas",
            "label": "knows",
            "type": "edge",
            "outV": "1:marko",
            "outVLabel": "person",
            "inV": "1:vadas",
            "inVLabel": "person",
            "properties": {
                "weight": 0.5,
                "date": "20160110"
            }
        },
        {
            "id": "S1:josh>2>>S2:lop",
            "label": "created",
            "type": "edge",
            "outV": "1:josh",
            "outVLabel": "person",
            "inV": "2:lop",
            "inVLabel": "software",
            "properties": {
                "weight": 0.4,
                "date": "20091111"
            }
        },
        {
            "id": "S1:marko>2>>S2:lop",
            "label": "created",
            "type": "edge",
            "outV": "1:marko",
            "outVLabel": "person",
            "inV": "2:lop",
            "inVLabel": "software",
            "properties": {
                "weight": 0.4,
                "date": "20171210"
            }
        },
        {
            "id": "S1:peter>2>>S2:lop",
            "label": "created",
            "type": "edge",
            "outV": "1:peter",
            "outVLabel": "person",
            "inV": "2:lop",
            "inVLabel": "software",
            "properties": {
                "weight": 0.2,
                "date": "20170324"
            }
        }
    ],
    "measure": {
        "edge_iterations": 12,
        "vertice_iterations": 12,
        "cost": 2
    }
}
image

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

DanGuge added 5 commits July 28, 2023 11:08
ApiMeasure will count the number of vertices and edges traversed at runtime, and the time the api takes to execute
…rface

* JsonSerializer: return measure information in api response

* Serializer: fit the feature that returns complete information about vertices and edges
…d Support full information about vertices and edges

Statistics information:

* add vertexIterCounter and edgeIterCounter in HugeTraverser.java to track traversed vertices and edges at run time

* modify all oltp restful apis to add statistics information in response

Full information about vertices and edges:

* add 'with_vertex' and 'with_edge' parameter option in apis

* modify oltp apis to support vertex and edge information in api response

* add EdgeRecord in HugeTraverser.java to record edges at run time and generate the edge information returned in api response

* modify Path and PathSet in HugeTraverser.java to support full edge information storage

* modify all traversers to support track of edge information at run time
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #2262 (559bff1) into master (b02c2bd) will decrease coverage by 3.56%.
The diff coverage is 64.88%.

@@             Coverage Diff              @@
##             master    #2262      +/-   ##
============================================
- Coverage     68.63%   65.08%   -3.56%     
- Complexity      977      981       +4     
============================================
  Files           498      498              
  Lines         40684    41240     +556     
  Branches       5681     5738      +57     
============================================
- Hits          27922    26839    -1083     
- Misses        10056    11746    +1690     
+ Partials       2706     2655      -51     
Files Changed Coverage Δ
...e/hugegraph/api/traversers/CustomizedPathsAPI.java 0.00% <0.00%> (ø)
.../org/apache/hugegraph/api/traversers/EdgesAPI.java 87.50% <ø> (ø)
...g/apache/hugegraph/api/traversers/VerticesAPI.java 0.00% <ø> (ø)
...ava/org/apache/hugegraph/config/ServerOptions.java 100.00% <ø> (ø)
...aph/job/algorithm/comm/TriangleCountAlgorithm.java 0.00% <0.00%> (ø)
...h/traversal/algorithm/CustomizePathsTraverser.java 0.00% <0.00%> (ø)
...aversal/algorithm/records/ShortestPathRecords.java 90.69% <ø> (ø)
...che/hugegraph/api/traversers/SameNeighborsAPI.java 34.09% <14.70%> (-65.91%) ⬇️
...aph/traversal/algorithm/SameNeighborTraverser.java 41.30% <20.68%> (-52.82%) ⬇️
...pi/src/main/java/org/apache/hugegraph/api/API.java 70.00% <51.72%> (-4.12%) ⬇️
... and 33 more

... and 72 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

return manager.serializer(g).writePaths("crosspoints", paths, true);
measure.addIterCount(traverser.vertexIterCounter.get(),
traverser.edgeIterCounter.get());
return manager.serializer(g, measure.getResult())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer to update the serializer(g) method and set default an ApiMeasure

Copy link
Contributor Author

@DanGuge DanGuge Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejected:

  1. ApiMeasurer should be passed in from an outside api implementation so that it can carry data
  2. not all apis need ApiMeasurer and keeping the ApiMeasurer null for those APIs can prevent ApiMeasurer from being serialized

@DanGuge DanGuge force-pushed the feature_measure_and_VE_info branch from d468e18 to e671963 Compare July 31, 2023 03:50
}

public Map<String, Object> measures() {
measures.put(COST, System.currentTimeMillis() - timeStart);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compute duration use System.nanoTime perfered

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

} else if (current instanceof MutableLong) {
MutableLong currentMutableLong = (MutableLong) current;
currentMutableLong.add(value);
} else if (current instanceof Long) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

measures.computeIfAbsent(key, MutableLong.new).add(value)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

private static CollectionFactory collectionFactory;
private final HugeGraph graph;
// for apimeasure
public AtomicLong edgeIterCounter = new AtomicLong(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better for this class to have no side effects?

Copy link
Contributor Author

@DanGuge DanGuge Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HugeTraverser is the root class of all traverser algorithms, and there is a need for all sub-traverser algorithms to count the measuring statistics during traversering. So I think of two ways to solve this problems:

  1. Give HugeTraverser the ability to track the measuring statistics;
  2. Track the measuing statistics in all traverser functions which the Traverser APIs would call

I think the first one is better & more elegant and this is the current implementation.

1. change System.currentTimeMillis() to System.nanoTime();
2. modify addCount()
.gitignore Outdated
Comment on lines 10 to 11
swagger-ui-*
hugegraph-dist/dist.sh
Copy link
Member

@imbajin imbajin Aug 11, 2023

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) @VGalaxies

yzBIrgUZmN

Copy link
Contributor Author

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

public static final String JSON = MediaType.APPLICATION_JSON_TYPE
.getSubtype();

.getSubtype();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep the origin style

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -224,8 +220,7 @@ protected void addCount(String key, long value) {
if (current == null) {
measures.put(key, new MutableLong(value));
} else if (current instanceof MutableLong) {
MutableLong currentMutableLong = (MutableLong) current;
currentMutableLong.add(value);
((MutableLong) measures.computeIfAbsent(key, MutableLong::new)).add(value);
} else if (current instanceof Long) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add else branch then throw an exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Path("graphs/{graph}/traversers/customizedpaths")
@Singleton
@Tag(name = "CustomizedPathsAPI")
public class CustomizedPathsAPI extends API {

private static final Logger LOG = Log.logger(CustomizedPathsAPI.class);

private static List<WeightedEdgeStep> step(HugeGraph graph,
PathRequest req) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also keep request name style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

HugeGraph g = graph(manager, graph);
Iterator<Vertex> sources = request.sources.vertices(g);
E.checkArgument(sources != null && sources.hasNext(),
"The source vertices can't be empty");

FusiformSimilarityTraverser traverser =
new FusiformSimilarityTraverser(g);
new FusiformSimilarityTraverser(g);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems one line is ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

E.checkArgument(!request.withVertex && !request.withPath,
"Can't return vertex or path when count only");
E.checkArgument(!request.withVertex && !request.withPath && !request.withEdge,
"Can't return vertex or path or edge when count only");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't return vertex, edge or path...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

public class CustomizedCrosspointsTraverser extends HugeTraverser {

private final EdgeRecord edgeRecord;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

public class CustomizePathsTraverser extends HugeTraverser {
private final EdgeRecord edgeRecord;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect a blank line, and prefer to rename to edgeResults.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -52,10 +50,11 @@ public abstract class PathTraverser {
protected Set<HugeTraverser.Path> paths;

protected TraverseStrategy traverseStrategy;
protected HugeTraverser.EdgeRecord edgeRecord;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just import EdgeRecord to keep the same style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return paths;
}

private class Traverser {

private final ShortestPathRecords record;
private final EdgeRecord edgeRecord;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to pathResults and edgeResults

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

result.add(nodes.get(random));
}
return result;
public EdgeRecord getEdgeRecord() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DanGuge DanGuge requested review from imbajin and zyxxoo August 17, 2023 07:16
@imbajin
Copy link
Member

imbajin commented Aug 17, 2023

Good job, thanks for ur contributuion & reaction

'll check this pr carefully later, @zyxxoo could ensure it now?

for (Path path : paths) {
List<Id> vertices = path.vertices();
int length = vertices.size();
if (intersection.contains(vertices.get(length - 1))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try keep origin code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to leave this static method in its original place?

I just formatted it automatically. The content of this method is the same as the original, and only the location has changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check it later(merge it first)

@imbajin imbajin merged commit d12f573 into apache:master Aug 19, 2023
@DanGuge DanGuge deleted the feature_measure_and_VE_info branch August 20, 2023 07:50
@DanGuge DanGuge restored the feature_measure_and_VE_info branch August 20, 2023 07:56
DanGuge added a commit to DanGuge/incubator-hugegraph that referenced this pull request Sep 25, 2023
…fo about vertices and edges (apache#2262)

* chore: improve gitignore file

* feat: add ApiMeasure to collect runtime data

ApiMeasure will count the number of vertices and edges traversed at runtime, and the time the api takes to execute

* feat: Add ApiMeasure to JsonSerializer and Modify the Serializer interface

* JsonSerializer: return measure information in api response

* Serializer: fit the feature that returns complete information about vertices and edges

* refactor: format code based on hugegraph-style.xml

* feat: Add statistics information in all oltp restful apis response and Support full information about vertices and edges

Statistics information:

* add vertexIterCounter and edgeIterCounter in HugeTraverser.java to track traversed vertices and edges at run time

* modify all oltp restful apis to add statistics information in response

Full information about vertices and edges:

* add 'with_vertex' and 'with_edge' parameter option in apis

* modify oltp apis to support vertex and edge information in api response

* add EdgeRecord in HugeTraverser.java to record edges at run time and generate the edge information returned in api response

* modify Path and PathSet in HugeTraverser.java to support full edge information storage

* modify all traversers to support track of edge information at run time

* fix: numeric cast

* fix: Jaccard Similarity api test

* fix: adjust the code style and naming convention

* Empty commit

* Empty commit

* fix:
1. change System.currentTimeMillis() to System.nanoTime();
2. modify addCount()

* fix: rollback change in .gitignore

* fix: rollback ServerOptions.java code style

* fix: rollback API.java code style and add exception in else branch

* fix: fix code style

* fix: name style & code style
* rename edgeRecord to edgeResults
* fix Request class code style in SameNeighborsAPI.java
VGalaxies pushed a commit to VGalaxies/incubator-hugegraph that referenced this pull request Nov 10, 2023
…fo about vertices and edges (apache#2262)

* chore: improve gitignore file

* feat: add ApiMeasure to collect runtime data

ApiMeasure will count the number of vertices and edges traversed at runtime, and the time the api takes to execute

* feat: Add ApiMeasure to JsonSerializer and Modify the Serializer interface

* JsonSerializer: return measure information in api response

* Serializer: fit the feature that returns complete information about vertices and edges

* refactor: format code based on hugegraph-style.xml

* feat: Add statistics information in all oltp restful apis response and Support full information about vertices and edges

Statistics information:

* add vertexIterCounter and edgeIterCounter in HugeTraverser.java to track traversed vertices and edges at run time

* modify all oltp restful apis to add statistics information in response

Full information about vertices and edges:

* add 'with_vertex' and 'with_edge' parameter option in apis

* modify oltp apis to support vertex and edge information in api response

* add EdgeRecord in HugeTraverser.java to record edges at run time and generate the edge information returned in api response

* modify Path and PathSet in HugeTraverser.java to support full edge information storage

* modify all traversers to support track of edge information at run time

* fix: numeric cast

* fix: Jaccard Similarity api test

* fix: adjust the code style and naming convention

* Empty commit

* Empty commit

* fix:
1. change System.currentTimeMillis() to System.nanoTime();
2. modify addCount()

* fix: rollback change in .gitignore

* fix: rollback ServerOptions.java code style

* fix: rollback API.java code style and add exception in else branch

* fix: fix code style

* fix: name style & code style
* rename edgeRecord to edgeResults
* fix Request class code style in SameNeighborsAPI.java
imbajin pushed a commit that referenced this pull request Nov 10, 2023
…fo about vertices and edges (#2262)

* chore: improve gitignore file

* feat: add ApiMeasure to collect runtime data

ApiMeasure will count the number of vertices and edges traversed at runtime, and the time the api takes to execute

* feat: Add ApiMeasure to JsonSerializer and Modify the Serializer interface

* JsonSerializer: return measure information in api response

* Serializer: fit the feature that returns complete information about vertices and edges

* refactor: format code based on hugegraph-style.xml

* feat: Add statistics information in all oltp restful apis response and Support full information about vertices and edges

Statistics information:

* add vertexIterCounter and edgeIterCounter in HugeTraverser.java to track traversed vertices and edges at run time

* modify all oltp restful apis to add statistics information in response

Full information about vertices and edges:

* add 'with_vertex' and 'with_edge' parameter option in apis

* modify oltp apis to support vertex and edge information in api response

* add EdgeRecord in HugeTraverser.java to record edges at run time and generate the edge information returned in api response

* modify Path and PathSet in HugeTraverser.java to support full edge information storage

* modify all traversers to support track of edge information at run time

* fix: numeric cast

* fix: Jaccard Similarity api test

* fix: adjust the code style and naming convention

* Empty commit

* Empty commit

* fix:
1. change System.currentTimeMillis() to System.nanoTime();
2. modify addCount()

* fix: rollback change in .gitignore

* fix: rollback ServerOptions.java code style

* fix: rollback API.java code style and add exception in else branch

* fix: fix code style

* fix: name style & code style
* rename edgeRecord to edgeResults
* fix Request class code style in SameNeighborsAPI.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants