Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zircon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zircon
Commits
03e14ad7
Commit
03e14ad7
authored
10 years ago
by
Michael Gray
Browse files
Options
Downloads
Patches
Plain Diff
Zircon::Timestamp.
parent
7b29d09d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/Zircon/Context/ZMQ.pm
+9
-7
9 additions, 7 deletions
lib/Zircon/Context/ZMQ.pm
lib/Zircon/Protocol/Serialiser.pm
+4
-2
4 additions, 2 deletions
lib/Zircon/Protocol/Serialiser.pm
lib/Zircon/Timestamp.pm
+21
-0
21 additions, 0 deletions
lib/Zircon/Timestamp.pm
with
34 additions
and
9 deletions
lib/Zircon/Context/ZMQ.pm
+
9
−
7
View file @
03e14ad7
...
...
@@ -9,11 +9,11 @@ use feature 'state';
use
Carp
qw( croak )
;
use
Errno
qw( EAGAIN ENODATA )
;
use
Readonly
;
use
Time::
HiRes
qw( gettimeofday )
;
use
ZMQ::
LibZMQ3
;
use
ZMQ::
Constants
qw(ZMQ_REP ZMQ_REQ ZMQ_LAST_ENDPOINT ZMQ_POLLIN ZMQ_FD ZMQ_DONTWAIT ZMQ_SNDMORE ZMQ_LINGER EFSM)
;
use
Zircon::
Timestamp
;
use
Zircon::Context::ZMQ::
Ctx
;
use
base
'
Zircon::Trace
';
...
...
@@ -238,13 +238,12 @@ sub _process_server_request {
my
$reply
=
$self
->
_request_callback
->
(
$self
->
_request_body
,
$request_header
,
$collision_result
);
$self
->
zircon_trace
("
reply: '%s'
",
$reply
//
'
<undef>
');
my
(
$sec
,
$usec
)
=
gettimeofday
;
my
$timestamp
=
Zircon::
Timestamp
->
timestamp
;
my
$reply_header
=
{
msg_type
=>
'
REPLY
',
request_id
=>
$request_header
->
{
request_id
},
request_attempt
=>
$request_header
->
{
request_attempt
},
clock_sec
=>
$sec
,
clock_usec
=>
$usec
,
%$timestamp
,
};
if
(
my
$e
=
$self
->
_send_two_part
(
$self
->
_zmq_responder
,
$reply_header
,
$reply
//
''))
{
...
...
@@ -291,12 +290,15 @@ sub send {
my
$error
=
'
unset
';
my
$zerr
;
my
(
$sec
,
$usec
)
=
gettimeofday
;
my
$timestamp
=
{};
unless
(
exists
$conn_header
->
{
clock_sec
}
and
exists
$conn_header
->
{
clock_usec
})
{
$timestamp
=
Zircon::
Timestamp
->
timestamp
;
}
my
$header
=
{
%$conn_header
,
%$timestamp
,
msg_type
=>
'
REQUEST
',
clock_sec
=>
$sec
,
clock_usec
=>
$usec
,
};
my
$responder
=
$self
->
_zmq_responder
;
...
...
This diff is collapsed.
Click to expand it.
lib/Zircon/Protocol/Serialiser.pm
+
4
−
2
View file @
03e14ad7
...
...
@@ -6,7 +6,8 @@ use warnings;
use
Carp
;
use
Scalar::
Util
qw( weaken )
;
use
Time::
HiRes
qw( gettimeofday )
;
use
Zircon::
Timestamp
;
use
Readonly
;
Readonly
my
$ZIRCON_PROTOCOL_VERSION
=>
'
3.0
';
...
...
@@ -133,7 +134,8 @@ sub _timestamp {
my
(
$self
)
=
@_
;
return
if
$self
->
inhibit_timestamps
;
my
(
$sec
,
$usec
)
=
gettimeofday
;
my
$timestamp
=
Zircon::
Timestamp
->
timestamp
;
my
(
$sec
,
$usec
)
=
@$timestamp
{
qw( clock_sec clock_usec )
};
return
('
request_time
'
=>
"
$sec
,
$usec
");
}
...
...
This diff is collapsed.
Click to expand it.
lib/Zircon/Timestamp.pm
0 → 100644
+
21
−
0
View file @
03e14ad7
package
Zircon::
Timestamp
;
use
strict
;
use
warnings
;
use
Time::
HiRes
qw( gettimeofday )
;
sub
timestamp
{
my
(
$sec
,
$usec
)
=
gettimeofday
;
return
{
clock_sec
=>
$sec
,
clock_usec
=>
$usec
,
};
}
1
;
=
head1
AUTHOR
Ana
Code
B
<
email
>
anacode@sanger
.
ac
.
uk
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment