Merged.
This commit is contained in:
1 parent
096787d710
commit
e6a9c7e433
150 files changed
+2757
-2765
No files matched your search
@@ -6,7 +6,7 @@
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/os/os.h"
|
||||
#include "lib/utils/TimeStamp.h"
|
||||
#include "lib/orderman/orderman_utils/PerfTraceLog.h"
|
||||
#include "lib/tracing/PerfLog.h"
|
||||
|
||||
#include <websocketpp/config/asio_no_tls.hpp>
|
||||
#include <websocketpp/server.hpp>
|
||||
@@ -54,9 +54,9 @@ namespace http {
|
||||
const api::ServiceContext& _ctx;
|
||||
metrics::MetricsContainer& _metrics;
|
||||
std::shared_ptr<metrics::HistogramMetric<4>> _mtimer;
|
||||
PerfTraceLog &_trace_log;
|
||||
trace::PerfLog &_perf_log;
|
||||
|
||||
ServerState(const api::ServiceContext& ctx, metrics::MetricsContainer& metrics, PerfTraceLog &l,int port) :
|
||||
ServerState(const api::ServiceContext& ctx, metrics::MetricsContainer& metrics, trace::PerfLog &l,int port) :
|
||||
_m(),
|
||||
_dispatcher(utils::Dispatcher::get_named("Webserver")),
|
||||
_session(),
|
||||
@@ -67,7 +67,7 @@ namespace http {
|
||||
_metrics(metrics),
|
||||
_mtimer(std::make_shared<metrics::HistogramMetric<4>>("spark_metrics_query_duration_ms",
|
||||
std::array<double,4>({ 0.5, 1.0, 5.0, 10.0 }))),
|
||||
_trace_log(l)
|
||||
_perf_log(l)
|
||||
{
|
||||
_www = os::sparkdata_path("www");
|
||||
_conf = os::sparkdata_path("conf");
|
||||
@@ -168,7 +168,7 @@ namespace http {
|
||||
void return_perf_trace_data(connection_ptr& con,size_t max_rows) {
|
||||
utils::TimeStamp start = utils::TimeStamp::now();
|
||||
std::stringstream ss;
|
||||
_trace_log.print_latest_traces(ss,max_rows);
|
||||
_perf_log.print_latest_traces(ss,max_rows);
|
||||
con->set_body(ss.str());
|
||||
con->set_status(websocketpp::http::status_code::ok);
|
||||
_mtimer->observe((utils::TimeStamp::now() - start).microseconds() / 1000.0);
|
||||
@@ -359,7 +359,7 @@ namespace http {
|
||||
|
||||
|
||||
|
||||
SparkWebServer::SparkWebServer(const api::ServiceContext& ctx, metrics::MetricsContainer& metrics, PerfTraceLog &l,int port) :
|
||||
SparkWebServer::SparkWebServer(const api::ServiceContext& ctx, metrics::MetricsContainer& metrics, trace::PerfLog &l,int port) :
|
||||
_me(std::make_shared<ServerState>(ctx, metrics, l,port))
|
||||
{
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user