Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cache/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int dnet_cmd_cache_io(struct dnet_backend_io *backend, struct dnet_net_state *st
cache_manager *cache = (cache_manager *)backend->cache;
std::shared_ptr<raw_data_t> d;

FORMATTED(HANDY_TIMER_SCOPE, ("cache.%s", dnet_cmd_string(cmd->cmd)));
HANDY_TIMER_SCOPE(("cache.%s", dnet_cmd_string(cmd->cmd)));

try {
switch (cmd->cmd) {
Expand Down
6 changes: 3 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ Build-Depends: cdbs,
python-pip,
python-virtualenv,
msgpack-python | python-msgpack,
handystats (>= 1.10.2)
handystats (>= 1.11.1)
Standards-Version: 3.8.0
Homepage: http://www.ioremap.net/projects/elliptics
XS-Python-Version: >= 2.6

Package: elliptics
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, eblob (>= 0.22.22), elliptics-client (= ${Source-Version}), libcocaine-core2, handystats (>= 1.10.0)
Depends: ${shlibs:Depends}, ${misc:Depends}, eblob (>= 0.22.22), elliptics-client (= ${Source-Version}), libcocaine-core2, handystats (>= 1.11.1)
Replaces: elliptics-2.10, srw
Provides: elliptics-2.10
Description: Distributed hash table storage
Elliptics network is a fault tolerant distributed hash table object storage.

Package: elliptics-client
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, msgpack-python | python-msgpack, handystats (>= 1.10.0)
Depends: ${shlibs:Depends}, ${misc:Depends}, msgpack-python | python-msgpack, handystats (>= 1.11.1)
Replaces: elliptics-2.10
Description: Distributed hash table storage (client library)
Elliptics network is a fault tolerant distributed hash table object storage.
Expand Down
2 changes: 1 addition & 1 deletion elliptics-bf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BuildRequires: eblob-devel >= 0.22.22
BuildRequires: libblackhole-devel >= 0.2.3-1
BuildRequires: libev-devel libtool-ltdl-devel
BuildRequires: cmake msgpack-devel python-msgpack
BuildRequires: handystats >= 1.10.2
BuildRequires: handystats >= 1.11.1

%define boost_ver %{nil}

Expand Down
2 changes: 1 addition & 1 deletion example/eblob_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ int blob_defrag_stop(void *priv)

static int eblob_backend_command_handler(void *state, void *priv, struct dnet_cmd *cmd, void *data)
{
FORMATTED(HANDY_TIMER_SCOPE, ("eblob_backend.cmd.%s", dnet_cmd_string(cmd->cmd)));
HANDY_TIMER_SCOPE(("eblob_backend.cmd.%s", dnet_cmd_string(cmd->cmd)));

int err;
struct eblob_backend_config *c = priv;
Expand Down
72 changes: 60 additions & 12 deletions example/handystats.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,69 @@
{
"statistics": {
"enable": true,
"dump-interval": 1000,

"defaults": {
"moving-interval": 1000,
"histogram-bins": 30,
"rate-unit": "s",
"tags": []
},
"timer": {
"histogram-bins": 30
},

"io.cmd.*.lock_time": {
"tags": ["quantile", "moving-avg"]
},

"io.cmd{,.[A-Z]*}": {
"tags": ["quantile", "moving-avg", "moving-count"]
},

"io.cmd_recursive{,.[A-Z]*}": {
"tags": ["quantile", "moving-avg"]
},

"cache.{READ,WRITE,DEL}": {
"tags": ["quantile", "moving-avg"]
},

"eblob_backend.cmd.{READ,WRITE,LOOKUP,DEL,READ_RANGE,DEL_RANGE}": {
"tags": ["quantile", "moving-avg"]
},

"io.notify.{update,add,remove}": {
"tags": ["quantile", "moving-avg"]
},

"io.{cmds,forwards,replies}": {
"tags": ["rate"]
},

"io.{input,output}.queue.size": {
"tags": ["rate", "moving-avg"]
},

"pool.*.{blocking,nonblocking}.queue.size": {
"tags": ["rate", "moving-avg"]
},

"pool.*.{blocking,nonblocking}.queue.wait_time": {
"tags": ["quantile", "moving-avg"]
},

"pool.*.{blocking,nonblocking}.active_threads": {
"tags": ["moving-avg"]
},

"metrics": {
"counter": {
"tags": ["moving-avg", "rate"]
},
"timer": {
"idle-timeout": 60000,
"tags": ["moving-avg", "quantile"]
}
"eblob.*.{lookup,cache.lookup,disk.{read,write,remove,lookup}}": {
"tags": ["quantile", "moving-avg", "moving-count"]
},

"eblob.*.disk.{read,write,remove}.errors.*": {
"tags": ["value", "rate", "moving-avg"]
},

"metrics-dump": {
"interval": 1000
"eblob.*.cache.size": {
"tags": ["value", "rate", "moving-avg"]
}
}
19 changes: 19 additions & 0 deletions example/handystats_minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"enable": true,

"defaults": {
"moving-interval": 1000,
"histogram-bins": 30,
"tags": ["moving-avg"]
},

"dump-interval": 1000,

"counter": {
"tags": ["moving-avg", "rate"]
},
"timer": {
"idle-timeout": 60000,
"tags": ["moving-avg", "quantile"]
}
}
4 changes: 2 additions & 2 deletions library/dnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,10 @@ int dnet_process_cmd_raw(struct dnet_backend_io *backend, struct dnet_net_state
int handled_in_cache = 0;

HANDY_TIMER_SCOPE(recursive ? "io.cmd_recursive" : "io.cmd");
FORMATTED(HANDY_TIMER_SCOPE, ("io.cmd%s.%s", (recursive ? "_recursive" : ""), dnet_cmd_string(cmd->cmd)));
HANDY_TIMER_SCOPE(("io.cmd%s.%s", (recursive ? "_recursive" : ""), dnet_cmd_string(cmd->cmd)));

if (!(cmd->flags & DNET_FLAGS_NOLOCK)) {
FORMATTED(HANDY_TIMER_SCOPE, ("io.cmd.%s.lock_time", dnet_cmd_string(cmd->cmd)));
HANDY_TIMER_SCOPE(("io.cmd.%s.lock_time", dnet_cmd_string(cmd->cmd)));
dnet_oplock(n, &cmd->id);
}

Expand Down
12 changes: 6 additions & 6 deletions library/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ void dnet_schedule_io(struct dnet_node *n, struct dnet_io_req *r)

pthread_mutex_unlock(&place->lock);

FORMATTED(HANDY_TIMER_START, ("pool.%s.queue.wait_time", thread_stat_id), (uint64_t)&r->req_entry);
FORMATTED(HANDY_COUNTER_INCREMENT, ("pool.%s.queue.size", thread_stat_id), 1);
HANDY_TIMER_START(("pool.%s.queue.wait_time", thread_stat_id), (uint64_t)&r->req_entry);
HANDY_COUNTER_INCREMENT(("pool.%s.queue.size", thread_stat_id), 1);
HANDY_COUNTER_INCREMENT("io.input.queue.size", 1);
}

Expand Down Expand Up @@ -1091,10 +1091,10 @@ void *dnet_io_process(void *data_)

HANDY_COUNTER_DECREMENT("io.input.queue.size", 1);

FORMATTED(HANDY_COUNTER_DECREMENT, ("pool.%s.queue.size", thread_stat_id), 1);
FORMATTED(HANDY_TIMER_STOP, ("pool.%s.queue.wait_time", thread_stat_id), (uint64_t)r);
HANDY_COUNTER_DECREMENT(("pool.%s.queue.size", thread_stat_id), 1);
HANDY_TIMER_STOP(("pool.%s.queue.wait_time", thread_stat_id), (uint64_t)r);

FORMATTED(HANDY_COUNTER_INCREMENT, ("pool.%s.active_threads", thread_stat_id), 1);
HANDY_COUNTER_INCREMENT(("pool.%s.active_threads", thread_stat_id), 1);

st = r->st;
cmd = r->header;
Expand All @@ -1115,7 +1115,7 @@ void *dnet_io_process(void *data_)
dnet_io_req_free(r);
dnet_state_put(st);

FORMATTED(HANDY_COUNTER_DECREMENT, ("pool.%s.active_threads", thread_stat_id), 1);
HANDY_COUNTER_DECREMENT(("pool.%s.active_threads", thread_stat_id), 1);
}

dnet_log(n, DNET_LOG_NOTICE, "finished io thread: #%d, nonblocking: %d, backend: %zd",
Expand Down
4 changes: 0 additions & 4 deletions monitor/measure_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
#else
#include <handystats/measuring_points.h>
#endif

#define __HANDY_NAME_USE BOOST_PP_CAT(__C_HANDY_NAME_BUF_, __LINE__)
#define __HANDY_NAME_SET(...) char __HANDY_NAME_USE[255]; snprintf(__HANDY_NAME_USE, (sizeof(__HANDY_NAME_USE) - 1), __VA_ARGS__)
#define FORMATTED(MACRO, NAME_ARGS, ...) __HANDY_NAME_SET NAME_ARGS; MACRO(__HANDY_NAME_USE, ##__VA_ARGS__)
#else
#include "monitor/handystats/stubs.h"
#endif
Expand Down