hi, i want to know the method which can help me to find out query execution time in sesame rdf framework.while i query with serql and sparql both.please help me.i need answer very urgently

asked 01 Apr '12, 14:57

amita's gravatar image

amita
652
accept rate: 0%

edited 01 Apr '12, 18:12

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
11.6k412

hi amita, and welcome to answers.semanticweb.com. To get the best use of out this site, please read the helpful tips at http://answers.semanticweb.com/questions/14494/welcome-to-answerssemanticwebcom

(02 Apr '12, 02:52) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

Sesame's API does not expose this information directly to you AFAIK

With Java you can do the following to time operations:

long start = System.nanoTime();

//Perform your operation

long duration = System.nanoTime() - start;

You can then convert the duration in nanoseconds into seconds like so:

long seconds = TimeUnit.NANOSECONDS.toSeconds(duration);
permanent link

answered 01 Apr '12, 16:36

Rob%20Vesse's gravatar image

Rob Vesse ♦
14.0k1715
accept rate: 29%

+1. Alternatively, you can look in the Sesame server logs to see how long any operation took to execute.

(01 Apr '12, 18:10) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

hi, where should apply this java code in sesame long start = System.nanoTime();

//Perform your operation

long duration = System.nanoTime() - start; please tell me.

(02 Apr '12, 01:58) amita amita's gravatar image

@amita, Rob's solution is simply to get the system time (System.nanoTime()) before executing the query, and again after executing it. The difference will be the time it took to execute the query.

(02 Apr '12, 02:56) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image
1

Definitely a better answer than mine for this comparable question: http://answers.semanticweb.com/questions/15603/query-response-time-for-sparql. But seeing the confusion of the OP, I'd stick with the stopwatch ;-)

(02 Apr '12, 05:44) Gerrit V Gerrit%20V's gravatar image

this method of find the time in sesame doesn't help me because whenever i give the query to it server logs doesn't give me query execution time and System.nanoTime() also not working please tell me another way

(02 Jun '12, 02:16) amita amita's gravatar image
1

@amita: no.

(02 Jun '12, 03:55) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image
showing 5 of 6 show 1 more comments

You can use sesame console for this purpose:

$ /path/to/sesame/root/bin/console
> connect http://localhost:8080/openrdf-sesame .
> open my_repository .
my_repository > sparql
There should be the query
.

http://localhost:8080/openrdf-sesame should be replaced with the your sesame instance url.

After execution of these commands the console will show the result of the query and execution time (including the time for network interaction) in milliseconds. The same is true for serql.

permanent link

answered 03 Jun '12, 05:07

citxx's gravatar image

citxx
1837
accept rate: 0%

edited 03 Jun '12, 05:11

This a java utility that would help you out.

Have tried it in one of my personal pet projects.

http://perf4j.codehaus.org/

StopWatch swatch=new LoggingStopWatch();

//Write all your querying logic in here]n

QueryExecution qexec=QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);

ResultSet rs=qexec.execSelect();

//this will print the time along with the passed message

swatch.stop("Results Obtained");

The reult would be something like this

start[1361269503870] time[1426] tag[Results Obtained]

Hope it helps :)

permanent link

answered 19 Feb '13, 05:26

Avinash's gravatar image

Avinash
314
accept rate: 0%

edited 19 Feb '13, 05:27

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×152
×4

question asked: 01 Apr '12, 14:57

question was seen: 1,913 times

last updated: 19 Feb '13, 05:27