Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3mon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
km3py
km3mon
Commits
00fc8c0b
Verified
Commit
00fc8c0b
authored
3 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Use Jpp 14.4.3
parent
8811adc2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docker-compose.yml
+4
-4
4 additions, 4 deletions
docker-compose.yml
ligiermirror/Dockerfile
+0
-8
0 additions, 8 deletions
ligiermirror/Dockerfile
ligiermirror/JLigierMirror.cc
+0
-124
0 additions, 124 deletions
ligiermirror/JLigierMirror.cc
ligiermirror/Makefile
+0
-1
0 additions, 1 deletion
ligiermirror/Makefile
with
4 additions
and
137 deletions
docker-compose.yml
+
4
−
4
View file @
00fc8c0b
version
:
"
3"
version
:
"
3"
services
:
services
:
ligier
:
ligier
:
image
:
"
docker.km3net.de/jpp:v14.
1.0
"
image
:
"
docker.km3net.de/jpp:v14.
4.3
"
command
:
JLigier -d2
command
:
JLigier -d2
volumes
:
volumes
:
-
./logs:/logs
-
./logs:/logs
...
@@ -9,10 +9,10 @@ services:
...
@@ -9,10 +9,10 @@ services:
-
${MONITORING_LIGIER_PORT}:5553
-
${MONITORING_LIGIER_PORT}:5553
ligiermirror
:
ligiermirror
:
build
:
./ligiermirror
image
:
"
docker.km3net.de/jpp:v14.4.3"
env_file
:
env_file
:
-
.env
-
.env
command
:
JLigierMirror -H ${DAQ_LIGIER_IP}:${DAQ_LIGIER_PORT} -X monitoring_ligier_1:5553 -t ${TAGS_TO_MIRROR}
command
:
JLigierMirror -H ${DAQ_LIGIER_IP}:${DAQ_LIGIER_PORT} -X monitoring_ligier_1:5553 -t
"
${TAGS_TO_MIRROR}
"
volumes
:
volumes
:
-
./logs:/logs
-
./logs:/logs
depends_on
:
depends_on
:
...
@@ -20,7 +20,7 @@ services:
...
@@ -20,7 +20,7 @@ services:
restart
:
unless-stopped
restart
:
unless-stopped
ligierlogmirror
:
ligierlogmirror
:
build
:
./ligiermirror
image
:
"
docker.km3net.de/jpp:v14.4.3"
env_file
:
env_file
:
-
.env
-
.env
command
:
JLigierMirror -H ${LOG_LIGIER_IP}:${LOG_LIGIER_PORT} -X monitoring_ligier_1:5553 -t MSG
command
:
JLigierMirror -H ${LOG_LIGIER_IP}:${LOG_LIGIER_PORT} -X monitoring_ligier_1:5553 -t MSG
...
...
This diff is collapsed.
Click to expand it.
ligiermirror/Dockerfile
deleted
100644 → 0
+
0
−
8
View file @
8811adc2
FROM
docker.km3net.de/jpp:v14.1.0
MAINTAINER Tamas Gal <tgal@km3net.de>
WORKDIR /ligiermirror
COPY . .
RUN source /Jpp/setenv.sh /Jpp && make && mv JLigierMirror /usr/local/bin
This diff is collapsed.
Click to expand it.
ligiermirror/JLigierMirror.cc
deleted
100644 → 0
+
0
−
124
View file @
8811adc2
#include
<chrono>
#include
<iostream>
#include
<set>
#include
<string>
#include
"Jeep/JParser.hh"
#include
"Jeep/JMessage.hh"
#include
"JNet/JControlHost.hh"
#include
"JSystem/JDate.hh"
/**
* \file
*
* A tool to forward messages with the given tags from one ControlHost server (e.g. JLigier) to another.
*
* The options <tt>-H \<source\>[:port]</tt> and <tt>-H \<target\>[:port]</tt>
* correponds to the hostname and the port of the source and target server, respectively.
* The options <tt>-t</tt> and <tt>-T</tt> correspond to the ControlHost tag(s)
* with the mode subscription "any" and subscription "all".
* \author tgal
*/
int
main
(
int
argc
,
const
char
*
argv
[])
{
using
namespace
std
;
string
source
;
string
target
;
int
report_interval
;
// in seconds
set
<
JNET
::
JTag
>
tagList
;
set
<
JNET
::
JTag
>
TagList
;
int
debug
;
try
{
JParser
<>
zap
(
"Program to forward messages from one ControlHost server to another."
);
zap
[
'H'
]
=
make_field
(
source
)
=
"localhost"
;
zap
[
'X'
]
=
make_field
(
target
)
=
"localhost"
;
zap
[
't'
]
=
make_field
(
tagList
);
zap
[
'T'
]
=
make_field
(
TagList
);
zap
[
'i'
]
=
make_field
(
report_interval
)
=
30
;
zap
[
'd'
]
=
make_field
(
debug
)
=
0
;
zap
[
't'
]
=
JPARSER
::
initialised
();
zap
[
'T'
]
=
JPARSER
::
initialised
();
zap
(
argc
,
argv
);
}
catch
(
const
exception
&
error
)
{
FATAL
(
error
.
what
()
<<
endl
);
}
if
(
tagList
.
empty
()
&&
TagList
.
empty
())
{
FATAL
(
"No tags specified."
);
}
using
namespace
JPP
;
cout
<<
"Forwarding messages from "
<<
endl
<<
" "
<<
source
<<
" -> "
<<
target
<<
endl
;
JControlHost
::
Throw
(
true
);
try
{
JControlHost
in
(
source
);
JControlHost
out
(
target
);
cout
<<
"with the following tags: "
;
{
JSubscriptionList
buffer
;
for
(
set
<
JTag
>::
const_iterator
i
=
tagList
.
begin
();
i
!=
tagList
.
end
();
++
i
)
{
buffer
.
add
(
JSubscriptionAny
(
*
i
));
cout
<<
*
i
<<
"(any) "
;
}
for
(
set
<
JTag
>::
const_iterator
i
=
TagList
.
begin
();
i
!=
TagList
.
end
();
++
i
)
{
buffer
.
add
(
JSubscriptionAll
(
*
i
));
cout
<<
*
i
<<
"(all) "
;
}
cout
<<
endl
;
in
.
Subscribe
(
buffer
);
in
.
SendMeAlways
();
}
JPrefix
prefix
;
vector
<
char
>
buffer
;
unsigned
int
message_count
=
0
;
float
milliseconds_passed
;
std
::
chrono
::
high_resolution_clock
::
time_point
start_time
=
std
::
chrono
::
high_resolution_clock
::
now
();
for
(
const
string
stop
(
"stop"
);
buffer
.
size
()
!=
stop
.
size
()
||
string
(
buffer
.
data
(),
stop
.
size
())
!=
stop
;
)
{
in
.
WaitHead
(
prefix
);
buffer
.
resize
(
prefix
.
getSize
());
in
.
GetFullData
(
buffer
.
data
(),
buffer
.
size
());
DEBUG
(
getDateAndTime
()
<<
' '
<<
left
<<
setw
(
8
)
<<
prefix
.
getTag
()
<<
' '
<<
right
<<
setw
(
8
)
<<
prefix
.
getSize
()
<<
endl
);
out
.
PutFullData
(
prefix
.
getTag
(),
buffer
.
data
(),
buffer
.
size
());
message_count
+=
1
;
milliseconds_passed
=
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
start_time
)
/
std
::
chrono
::
milliseconds
(
1
);
if
(
milliseconds_passed
>
report_interval
*
1e3
)
{
cout
<<
getDateAndTime
()
<<
" : "
<<
"Message rate: "
<<
message_count
/
milliseconds_passed
*
1e3
<<
" Hz"
<<
endl
;
start_time
=
std
::
chrono
::
high_resolution_clock
::
now
();
message_count
=
0
;
}
}
}
catch
(
const
JControlHostException
&
error
)
{
ERROR
(
error
<<
endl
);
}
}
This diff is collapsed.
Click to expand it.
ligiermirror/Makefile
deleted
100644 → 0
+
0
−
1
View file @
8811adc2
include
$(JPP_DIR)/make/JMakefile
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