summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2013-03-26 00:41:12 -0500
committerJosh Blum2013-03-26 00:41:12 -0500
commit38b24b7ef6e3d82c1a14b93c4ffafadbc2f1ae9b (patch)
treee33b921fb968ff14f260ee5b4afa254733ee37de
parenta23b425c689ac66cd4d6e986b8a4292e19fc9710 (diff)
downloadsandhi-38b24b7ef6e3d82c1a14b93c4ffafadbc2f1ae9b.tar.gz
sandhi-38b24b7ef6e3d82c1a14b93c4ffafadbc2f1ae9b.tar.bz2
sandhi-38b24b7ef6e3d82c1a14b93c4ffafadbc2f1ae9b.zip
gras: rename stats to query
m---------grextras0
-rw-r--r--include/gras/top_block.hpp7
-rw-r--r--lib/CMakeLists.txt2
-rw-r--r--lib/top_block_query.cpp (renamed from lib/top_block_stats.cpp)2
-rw-r--r--python/gras/CMakeLists.txt2
-rw-r--r--python/gras/GRAS_HierBlock.i4
-rw-r--r--python/gras/query/CMakeLists.txt (renamed from python/gras/stats/CMakeLists.txt)4
-rw-r--r--python/gras/query/__init__.py (renamed from python/gras/stats/__init__.py)8
-rw-r--r--python/gras/query/chart_factory.js (renamed from python/gras/stats/chart_factory.js)0
-rw-r--r--python/gras/query/chart_handler_breakdown.js (renamed from python/gras/stats/chart_handler_breakdown.js)0
-rw-r--r--python/gras/query/chart_overall_throughput.js (renamed from python/gras/stats/chart_overall_throughput.js)0
-rw-r--r--python/gras/query/chart_overhead_compare.js (renamed from python/gras/stats/chart_overhead_compare.js)0
-rw-r--r--python/gras/query/chart_total_io_counts.js (renamed from python/gras/stats/chart_total_io_counts.js)0
-rw-r--r--python/gras/query/main.css (renamed from python/gras/stats/main.css)0
-rw-r--r--python/gras/query/main.html (renamed from python/gras/stats/main.html)0
-rw-r--r--python/gras/query/main.js (renamed from python/gras/stats/main.js)0
-rw-r--r--python/gras/query/utils.js (renamed from python/gras/stats/utils.js)0
17 files changed, 15 insertions, 14 deletions
diff --git a/grextras b/grextras
-Subproject 31deb5eb68c7b4cb36ae4773359a6ffbe3e6fc0
+Subproject a3b79c7c7f77436a2757afef053d55ed0405c67
diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp
index e288d95..f99d341 100644
--- a/include/gras/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -78,11 +78,12 @@ struct GRAS_API TopBlock : HierBlock
virtual bool wait(const double timeout);
/*!
- * Get block usage statistics in some format.
- * Args are used to set the query parameters.
+ * Query the flow graph for information.
* An external app will visualize the data.
+ * \param args the input query args
+ * \return formatted result of the query
*/
- virtual std::string get_stats(const std::string &args);
+ virtual std::string query(const std::string &args);
};
} //namespace gras
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index e667570..fa15efa 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -55,7 +55,7 @@ list(APPEND GRAS_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/output_handlers.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hier_block.cpp
${CMAKE_CURRENT_SOURCE_DIR}/top_block.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/top_block_stats.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/top_block_query.cpp
${CMAKE_CURRENT_SOURCE_DIR}/register_messages.cpp
${CMAKE_CURRENT_SOURCE_DIR}/theron_allocator.cpp
)
diff --git a/lib/top_block_stats.cpp b/lib/top_block_query.cpp
index 04fc7ae..1a6376c 100644
--- a/lib/top_block_stats.cpp
+++ b/lib/top_block_query.cpp
@@ -22,7 +22,7 @@ struct GetStatsReceiver : Theron::Receiver
std::vector<GetStatsMessage> messages;
};
-std::string TopBlock::get_stats(const std::string &)
+std::string TopBlock::query(const std::string &)
{
//get stats with custom receiver and set high prio
GetStatsReceiver receiver;
diff --git a/python/gras/CMakeLists.txt b/python/gras/CMakeLists.txt
index f3ef329..e91d8df 100644
--- a/python/gras/CMakeLists.txt
+++ b/python/gras/CMakeLists.txt
@@ -1,7 +1,7 @@
########################################################################
# add subdirs
########################################################################
-add_subdirectory(stats)
+add_subdirectory(query)
########################################################################
# Include swig generation macros
diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i
index 32c823b..12a5952 100644
--- a/python/gras/GRAS_HierBlock.i
+++ b/python/gras/GRAS_HierBlock.i
@@ -75,10 +75,10 @@ struct TopBlockPython : TopBlock
return TopBlock::wait(timeout);
}
- std::string get_stats(const std::string &args)
+ std::string query(const std::string &args)
{
PyTSPhondler phil;
- return TopBlock::get_stats(args);
+ return TopBlock::query(args);
}
};
diff --git a/python/gras/stats/CMakeLists.txt b/python/gras/query/CMakeLists.txt
index 54502a5..ab49532 100644
--- a/python/gras/stats/CMakeLists.txt
+++ b/python/gras/query/CMakeLists.txt
@@ -6,7 +6,7 @@ include(GrPython)
GR_PYTHON_INSTALL(
FILES
__init__.py
- DESTINATION ${GR_PYTHON_DIR}/gras/stats
+ DESTINATION ${GR_PYTHON_DIR}/gras/query
COMPONENT ${GRAS_COMP_PYTHON}
)
@@ -21,6 +21,6 @@ INSTALL(
chart_handler_breakdown.js
chart_total_io_counts.js
main.css
- DESTINATION ${GR_PYTHON_DIR}/gras/stats
+ DESTINATION ${GR_PYTHON_DIR}/gras/query
COMPONENT ${GRAS_COMP_PYTHON}
)
diff --git a/python/gras/stats/__init__.py b/python/gras/query/__init__.py
index 330abd4..5789fab 100644
--- a/python/gras/stats/__init__.py
+++ b/python/gras/query/__init__.py
@@ -15,11 +15,11 @@ class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(s):
"""Respond to a GET request."""
- if s.path.endswith('stats.xml'):
+ if s.path.endswith('.xml'):
s.send_response(200)
s.send_header("Content-type", "text/xml")
s.end_headers()
- s.wfile.write(server_registry[s.server].get_stats(""))
+ s.wfile.write(server_registry[s.server]['top_block'].query(s.path))
return
path = s.path
if path.startswith('/'): path = path[1:]
@@ -41,10 +41,10 @@ class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
import select
class http_server(object):
- def __init__(self, args, top_block):
+ def __init__(self, args, **kwargs):
server_class = BaseHTTPServer.HTTPServer
self._httpd = server_class(args, MyHandler)
- server_registry[self._httpd] = top_block
+ server_registry[self._httpd] = kwargs
def serve_forever(self):
while True:
diff --git a/python/gras/stats/chart_factory.js b/python/gras/query/chart_factory.js
index 3d2b0bc..3d2b0bc 100644
--- a/python/gras/stats/chart_factory.js
+++ b/python/gras/query/chart_factory.js
diff --git a/python/gras/stats/chart_handler_breakdown.js b/python/gras/query/chart_handler_breakdown.js
index 8e90fc3..8e90fc3 100644
--- a/python/gras/stats/chart_handler_breakdown.js
+++ b/python/gras/query/chart_handler_breakdown.js
diff --git a/python/gras/stats/chart_overall_throughput.js b/python/gras/query/chart_overall_throughput.js
index 4947479..4947479 100644
--- a/python/gras/stats/chart_overall_throughput.js
+++ b/python/gras/query/chart_overall_throughput.js
diff --git a/python/gras/stats/chart_overhead_compare.js b/python/gras/query/chart_overhead_compare.js
index c373142..c373142 100644
--- a/python/gras/stats/chart_overhead_compare.js
+++ b/python/gras/query/chart_overhead_compare.js
diff --git a/python/gras/stats/chart_total_io_counts.js b/python/gras/query/chart_total_io_counts.js
index 5aaaf24..5aaaf24 100644
--- a/python/gras/stats/chart_total_io_counts.js
+++ b/python/gras/query/chart_total_io_counts.js
diff --git a/python/gras/stats/main.css b/python/gras/query/main.css
index b5f62f1..b5f62f1 100644
--- a/python/gras/stats/main.css
+++ b/python/gras/query/main.css
diff --git a/python/gras/stats/main.html b/python/gras/query/main.html
index eeb221d..eeb221d 100644
--- a/python/gras/stats/main.html
+++ b/python/gras/query/main.html
diff --git a/python/gras/stats/main.js b/python/gras/query/main.js
index a27c0b7..a27c0b7 100644
--- a/python/gras/stats/main.js
+++ b/python/gras/query/main.js
diff --git a/python/gras/stats/utils.js b/python/gras/query/utils.js
index f5e5ee8..f5e5ee8 100644
--- a/python/gras/stats/utils.js
+++ b/python/gras/query/utils.js