Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313239
Provenance.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
Provenance.java
View Options
package
org.softwareheritage.graph.benchmark
;
import
com.martiansoftware.jsap.JSAPException
;
import
org.softwareheritage.graph.Graph
;
import
org.softwareheritage.graph.server.Endpoint
;
import
java.io.IOException
;
/**
* Benchmark Software Heritage <a
* href="https://docs.softwareheritage.org/devel/swh-graph/use-cases.html#provenance">provenance
* use-cases scenarios</a>.
*
* @author The Software Heritage developers
*/
public
class
Provenance
{
/**
* Main entrypoint.
*
* @param args command line arguments
*/
public
static
void
main
(
String
[]
args
)
throws
IOException
,
JSAPException
{
Benchmark
bench
=
new
Benchmark
();
bench
.
parseCommandLineArgs
(
args
);
Graph
graph
=
new
Graph
(
bench
.
args
.
graphPath
);
long
[]
nodeIds
=
bench
.
args
.
random
.
generateNodeIds
(
graph
,
bench
.
args
.
nbNodes
);
Endpoint
commitProvenanceEndpoint
=
new
Endpoint
(
graph
,
"backward"
,
"dir:dir,cnt:dir,dir:rev"
);
Endpoint
originProvenanceEndpoint
=
new
Endpoint
(
graph
,
"backward"
,
"*"
);
System
.
out
.
println
(
"Used "
+
bench
.
args
.
nbNodes
+
" random nodes (results are in seconds):"
);
bench
.
createCSVLogFile
();
bench
.
timeEndpoint
(
"commit provenance (dfs)"
,
graph
,
nodeIds
,
commitProvenanceEndpoint:
:
walk
,
"rev"
,
"dfs"
);
bench
.
timeEndpoint
(
"commit provenance (bfs)"
,
graph
,
nodeIds
,
commitProvenanceEndpoint:
:
walk
,
"rev"
,
"bfs"
);
bench
.
timeEndpoint
(
"complete commit provenance"
,
graph
,
nodeIds
,
commitProvenanceEndpoint:
:
leaves
);
bench
.
timeEndpoint
(
"origin provenance (dfs)"
,
graph
,
nodeIds
,
originProvenanceEndpoint:
:
walk
,
"ori"
,
"dfs"
);
bench
.
timeEndpoint
(
"origin provenance (bfs)"
,
graph
,
nodeIds
,
originProvenanceEndpoint:
:
walk
,
"ori"
,
"bfs"
);
bench
.
timeEndpoint
(
"complete origin provenance"
,
graph
,
nodeIds
,
originProvenanceEndpoint:
:
leaves
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Thu, Jul 3, 11:29 AM (5 d, 16 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3287375
Attached To
rDGRPH Compressed graph representation
Event Timeline
Log In to Comment