On Thu, Aug 20, 2015 at 11:36 PM, Conrad Leonard
<
conrad....@hotmail.com> wrote:
> huh, so this was my misunderstanding of the logs. They're not out of sync,
> and in fact now I understand the access.log doesn't actually contain any
> information about query running time.
Correct. Access log only contains an entry for query start events.
> What was happening was this:
>
> I export the access.log from the server to a client machine, read it using
> ProtoBufLogReader, in particular looking at the executionTime property of
> the DefaultQueryInfo, and was seeing a minimum value for executionTime of
> the offset between client and server.
>
> What I hadn't noticed is that the access.log entries are created at query
> start time; the endTime property is always -1, and getExecutionTime() must
> be returning (now() - startTime()) if endTime is -1. So in fact the
> "executionTime" value I read in access.log is always whatever time it is
> right now on whatever machine is reading the logs, minus the query start
> time.
Yes, that's how `getExecutionTime()` behaves [1] and where the issue
with out of sync clocks occurs.
>
> Having discovered this, is there an out-of-the-box method to track query
> running times? Does audit-level logging record query end time?
Yes, audit log will include query end events too which will have the
end time set by the server so the execution time will be correct. The
other possibility is to use the slow query log. This log looks at only
query end events and if you set `logging.slow_query.time = 0s` then
you'll get all query execution times in the log. By default, slow
query log uses a special human-readable format but you can use the
protobuf text or binary formats too.
Best,
Evren
[1]
http://docs.stardog.com/java/snarl/com/complexible/stardog/QueryInfo.html#getExecutionTime()