Skip to content

Commit

Permalink
collect opened connections between reportings
Browse files Browse the repository at this point in the history
  • Loading branch information
lwalkin committed Nov 15, 2016
1 parent cad59e8 commit c904140
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

1.x:
* Support rsv1, rsv2, rsv3 reserved flags in in \{ws.* <reserved-flag>}.
* Fix statsd output for connections.opened.

1.0: 2016-Sep-29
* Export --latency-connect and --latency-first-bytes to statsd.
Expand Down
5 changes: 4 additions & 1 deletion src/tcpkali_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ open_connections_until_maxed_out(enum work_phase phase, struct oc_args *args) {
pacefier_init(&keepup_pace, now);

ssize_t conn_deficit = 1; /* Assume connections still have to be est. */
size_t opened_until_reported = 0;

statsd_report_latency_types requested_latency_types =
engine_params(args->eng)->latency_setting;
Expand Down Expand Up @@ -283,6 +284,7 @@ open_connections_until_maxed_out(enum work_phase phase, struct oc_args *args) {
if(to_start > (size_t)conn_deficit) {
to_start = conn_deficit;
}
opened_until_reported += to_start;
engine_initiate_new_connections(args->eng, to_start);
pacefier_moved(&keepup_pace, args->connect_rate, allowed, now);

Expand All @@ -307,13 +309,14 @@ open_connections_until_maxed_out(enum work_phase phase, struct oc_args *args) {
engine_prepare_latency_snapshot(args->eng);
struct latency_snapshot *latency = engine_collect_latency_snapshot(args->eng);

statsd_feedback feedback = {.opened = to_start,
statsd_feedback feedback = {.opened = opened_until_reported,
.conns_in = conns_in,
.conns_out = conns_out,
.bps_in = bps_in,
.bps_out = bps_out,
.traffic_delta = traffic_delta,
.latency = NULL};
opened_until_reported = 0;

if(requested_latency_types && args->latency_window) {
/*
Expand Down

0 comments on commit c904140

Please sign in to comment.