Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
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
Model 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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duncan Macleod
gstlal
Commits
1365eb80
Commit
1365eb80
authored
7 years ago
by
Patrick Godwin
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_etg: fixed bottle route issues with etg subsets, removed redundant import statement
parent
90c41b0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-ugly/bin/gstlal_etg
+13
-10
13 additions, 10 deletions
gstlal-ugly/bin/gstlal_etg
with
13 additions
and
10 deletions
gstlal-ugly/bin/gstlal_etg
+
13
−
10
View file @
1365eb80
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
from optparse import OptionParser
from optparse import OptionParser
from collections import deque
from collections import deque
import json
import os
import os
import sys
import sys
import socket
import socket
...
@@ -57,7 +58,6 @@ from gstlal import aggregator
...
@@ -57,7 +58,6 @@ from gstlal import aggregator
from gstlal import idq_aggregator
from gstlal import idq_aggregator
from gstlal import httpinterface
from gstlal import httpinterface
from gstlal import bottle
from gstlal import bottle
from glue.ligolw import utils as ligolw_utils
from glue import iterutils
from glue import iterutils
from glue.ligolw import ligolw
from glue.ligolw import ligolw
from glue.ligolw import utils as ligolw_utils
from glue.ligolw import utils as ligolw_utils
...
@@ -204,7 +204,7 @@ class MultiChannelHandler(simplehandler.Handler):
...
@@ -204,7 +204,7 @@ class MultiChannelHandler(simplehandler.Handler):
#
set
up
ETG
bottle
related
properties
#
set
up
ETG
bottle
related
properties
self.etg_event =
deque(maxlen
=
20000)
self.etg_event =
deque(maxlen
=
20000)
self.
last
_event_time =
None
self.
etg
_event_time =
None
#
set
up
bottle
routes
for
PSDs
and
extracted
ETG
data
#
set
up
bottle
routes
for
PSDs
and
extracted
ETG
data
self.psds =
{}
self.psds =
{}
...
@@ -251,12 +251,12 @@ class MultiChannelHandler(simplehandler.Handler):
...
@@ -251,12 +251,12 @@ class MultiChannelHandler(simplehandler.Handler):
channel
,
rate =
sink_dict[elem]
channel
,
rate =
sink_dict[elem]
#
push
new
etg
event
to
queue
if
done
processing
current
timestamp
#
push
new
etg
event
to
queue
if
done
processing
current
timestamp
if
self.
last
_event_time
is
None:
if
self.
etg
_event_time
is
None:
self.
last
_event_time =
buftime
self.
etg
_event_time =
buftime
if
self.
last
_event_time
<
buftime:
if
self.
etg
_event_time
<
buftime:
self.etg_data.append
(
list
(
self.etg_event
))
self.etg_data.append
(
{
self.etg_event_time:
list
(
self.etg_event
)
}
)
self.etg_event.clear
()
self.etg_event.clear
()
self.
last
_event_time =
buftime
self.
etg
_event_time =
buftime
#
set
save
times
appropriately
#
set
save
times
appropriately
if
self.last_save_time
is
None:
if
self.last_save_time
is
None:
...
@@ -460,14 +460,17 @@ class MultiChannelHandler(simplehandler.Handler):
...
@@ -460,14 +460,17 @@ class MultiChannelHandler(simplehandler.Handler):
return outstr
return outstr
def web_get_etg_data(self):
def web_get_etg_data(self):
header = {'Content-type': 'application/json'}
# if queue is empty, send appropriate response
# if queue is empty, send appropriate response
if not self.etg_data:
if not self.etg_data:
return bottle.HTTPResponse(status = 204, body = "No Response")
status = 204
body = json.dumps({'error': "No Content"})
# else, get etg data and send as JSON
# else, get etg data and send as JSON
else:
else:
status = 200
with self.lock:
with self.lock:
response
= json.
encode
(self.etg_data.popleft())
body
= json.
dumps
(self.etg_data.popleft())
return
response
return
bottle.HTTPResponse(status = status, headers = header, body = body)
class LinkedAppSync(pipeparts.AppSync):
class LinkedAppSync(pipeparts.AppSync):
def __init__(self, appsink_new_buffer, sink_dict = {}):
def __init__(self, appsink_new_buffer, sink_dict = {}):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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