[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 24/50: controlport: adding performance and
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 24/50: controlport: adding performance and controlport monitor GRC blocks. |
Date: |
Wed, 15 Apr 2015 21:07:54 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 636c1557936ca004dce4c905eb7f337ad5677c60
Author: Tom Rondeau <address@hidden>
Date: Mon Mar 2 19:29:37 2015 -0500
controlport: adding performance and controlport monitor GRC blocks.
Updated thrift server conf to set an endpoint
-- need to get host address instead of hardcoding to 127.0.0.1.
---
.../include/gnuradio/thrift_server_template.h | 14 +++++--
.../python/gnuradio/ctrlport/monitor.py | 6 +--
gr-blocks/grc/blocks_block_tree.xml | 2 +
gr-blocks/grc/blocks_ctrlport_performance.xml | 48 ++++++++++++++++++++++
gr-blocks/grc/blocks_ctrlport_viewer.xml | 48 ++++++++++++++++++++++
5 files changed, 111 insertions(+), 7 deletions(-)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index 0676826..5b97b0a 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -100,8 +100,6 @@ thrift_server_template<TserverBase, TserverClass,
TImplClass, TThriftClass>::thr
gr::logger_ptr logger, debug_logger;
gr::configure_default_loggers(logger, debug_logger, "controlport");
- //GR_LOG_DEBUG(debug_logger, "thrift_server_template: ctor");
-
unsigned int port, nthreads, buffersize;
std::string thrift_config_file =
gr::prefs::singleton()->get_string("ControlPort", "config", "");
@@ -156,9 +154,9 @@ thrift_server_template<TserverBase, TserverClass,
TImplClass, TThriftClass>::thr
threadManager);
}
- // Define the endpoint
int used_port =
((thrift::transport::TServerSocket*)serverTransport.get())->getPort();
- GR_LOG_INFO(logger, boost::format("Apache Thrift Endpoint on port %1%") %
used_port);
+ std::string endpoint = boost::str(boost::format("%1% -p %2%") % "127.0.0.1"
% used_port);
+ GR_LOG_INFO(logger, "Apache Thrift: " + endpoint);
d_server = handler.get();
}
@@ -172,6 +170,14 @@ template<typename TserverBase, typename TserverClass,
typename TImplClass, typen
TserverBase* thrift_server_template<TserverBase, TserverClass, TImplClass,
TThriftClass>::i_impl()
{
//std::cerr << "thrift_server_template: i_impl" << std::endl;
+
+ // Define the endpoint
+ thrift::transport::TServerTransport *thetransport =
+ thrift_application_base<TserverBase,
TImplClass>::d_thriftserver->getServerTransport().get();
+ int used_port = ((thrift::transport::TServerSocket*)thetransport)->getPort();
+ std::string endpoint = boost::str(boost::format("%1% -p %2%") % "127.0.0.1"
% used_port);
+ thrift_application_base<TserverBase,
TImplClass>::d_this->set_endpoint(endpoint);
+
return d_server;
}
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
index 8bb26d9..712137f 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
@@ -48,9 +48,9 @@ class monitor:
print "monitor::endpoints() = %s" % (gr.rpcmanager_get().endpoints())
try:
cmd = map(lambda a: [self.tool,
-
re.search("\d+\.\d+\.\d+\.\d+",a).group(0),
- re.search("-p
(\d+)",a).group(1)],
-
gr.rpcmanager_get().endpoints())[0]
+ re.search("\d+\.\d+\.\d+\.\d+",a).group(0),
+ re.search("-p (\d+)",a).group(1)],
+ gr.rpcmanager_get().endpoints())[0]
print "running: %s"%(str(cmd))
self.proc = subprocess.Popen(cmd);
self.started = True
diff --git a/gr-blocks/grc/blocks_block_tree.xml
b/gr-blocks/grc/blocks_block_tree.xml
index 383ec87..0aab2ea 100644
--- a/gr-blocks/grc/blocks_block_tree.xml
+++ b/gr-blocks/grc/blocks_block_tree.xml
@@ -51,6 +51,8 @@
</cat>
<cat>
<name>Control Port</name>
+ <block>blocks_ctrlport_monitor</block>
+ <block>blocks_ctrlport_monitor_performance</block>
<block>blocks_ctrlport_probe2_x</block>
<block>blocks_ctrlport_probe2_c</block>
<block>blocks_ctrlport_probe_c</block>
diff --git a/gr-blocks/grc/blocks_ctrlport_performance.xml
b/gr-blocks/grc/blocks_ctrlport_performance.xml
new file mode 100644
index 0000000..ab17c9e
--- /dev/null
+++ b/gr-blocks/grc/blocks_ctrlport_performance.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This file is part of GNU Radio
+
+ GNU Radio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GNU Radio is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Radio; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street,
+ Boston, MA 02110-1301, USA.
+-->
+
+<block>
+ <name>CtrlPort Performance Monitor</name>
+ <key>blocks_ctrlport_monitor_performance</key>
+ <import>from gnuradio.ctrlport.monitor import *</import>
+ <make>not $en or monitor("gr-perf-monitorx")</make>
+ <param>
+ <name>Enabled</name>
+ <key>en</key>
+ <value></value>
+ <type>enum</type>
+ <option>
+ <name>True</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>False</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <doc>
+ Place this in a graph to launch a QtPy GR CtrlPort Performance Monitor app.
+ </doc>
+
+</block>
diff --git a/gr-blocks/grc/blocks_ctrlport_viewer.xml
b/gr-blocks/grc/blocks_ctrlport_viewer.xml
new file mode 100644
index 0000000..1d5a2e5
--- /dev/null
+++ b/gr-blocks/grc/blocks_ctrlport_viewer.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This file is part of GNU Radio
+
+ GNU Radio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GNU Radio is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Radio; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street,
+ Boston, MA 02110-1301, USA.
+-->
+
+<block>
+ <name>CtrlPort Monitor</name>
+ <key>blocks_ctrlport_monitor</key>
+ <import>from gnuradio.ctrlport.monitor import *</import>
+ <make>not $en or monitor()</make>
+ <param>
+ <name>Enabled</name>
+ <key>en</key>
+ <value></value>
+ <type>enum</type>
+ <option>
+ <name>True</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>False</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <doc>
+ Place this in a graph to launch a QtPy GR CtrlPort Monitor app.
+ </doc>
+
+</block>
- [Commit-gnuradio] [gnuradio] 20/50: runtime: more generic version of prefs class., (continued)
- [Commit-gnuradio] [gnuradio] 20/50: runtime: more generic version of prefs class., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 22/50: cmake: force QA tests to turn ControlPort off by default., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 15/50: controlport: convert rpcpmtconverter::to_pmt() if statement to a function object map, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 01/50: Initial thrift definition for gnuradio, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 14/50: controlport: Thrift's binary type, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 09/50: controlport: cleanup and switching over to new Python common interface., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 23/50: controlport: cleaning up and using logger to display endpoint., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 34/50: controlport: replacement of nanosleep() with boost::sleep() in startup thread. Fix of merge error in booter_thrift., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 28/50: controlport: more cleaning up., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 31/50: controlport: moving the logger call that publishes Thrift's endpoint to i_impl()., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 24/50: controlport: adding performance and controlport monitor GRC blocks.,
git <=
- [Commit-gnuradio] [gnuradio] 29/50: controlport: changing the default port number on the Thrift interface to zero., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 21/50: controlport: Adds ability to configure Thrift through a config file, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 30/50: controlport: ephemeral / unused port number selection by OS working., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 13/50: controlport: using threaded server for multiple connections., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 39/50: controlport: documentation cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 35/50: controlport: cleanup, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 33/50: controlport: more cleanup and conveniences, git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 11/50: controlport: more work on the translation layer; properties and setting parameters in gr-ctrlport-monitor now working., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 45/50: controlport: ensure proper ctrlport shutdown., git, 2015/04/16
- [Commit-gnuradio] [gnuradio] 08/50: controlport: adding abstraction layer for the controlport backends; support thrift currently., git, 2015/04/16