tracing: add a serializable trace_info object

tracing::trace_info is used to pass the tracing information between nodes.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This commit is contained in:
Vlad Zolotarov
2016-05-23 20:36:46 +03:00
parent 099ff0d2d5
commit a53d329b25
3 changed files with 50 additions and 0 deletions

View File

@@ -535,6 +535,7 @@ idls = ['idl/gossip_digest.idl.hh',
'idl/query.idl.hh',
'idl/idl_test.idl.hh',
'idl/commitlog.idl.hh',
'idl/tracing.idl.hh',
]
scylla_tests_dependencies = scylla_core + api + idls + [

35
idl/tracing.idl.hh Normal file
View File

@@ -0,0 +1,35 @@
/*
* Copyright 2016 ScyllaDB
*/
/*
* This file is part of Scylla.
*
* Scylla is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Scylla 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 Scylla. If not, see <http://www.gnu.org/licenses/>.
*/
namespace tracing {
enum class trace_type : uint8_t {
NONE,
QUERY,
REPAIR,
};
class trace_info {
utils::UUID session_id;
tracing::trace_type type;
bool flush_on_close;
};
}

View File

@@ -83,6 +83,20 @@ inline gc_clock::duration ttl_by_type(const trace_type t) {
}
}
class trace_info {
public:
utils::UUID session_id;
trace_type type;
bool flush_on_close;
public:
trace_info(utils::UUID sid, trace_type t, bool f_o_c)
: session_id(std::move(sid))
, type(t)
, flush_on_close(f_o_c)
{ }
};
struct i_tracing_backend_helper {
virtual ~i_tracing_backend_helper() {}
virtual future<> start() = 0;