Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added counters to track more metrics on dashboard #1535

Merged
merged 1 commit into from
Oct 18, 2018
Merged
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
14 changes: 13 additions & 1 deletion scripts/net-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ receive_errors=0
receive_errors_diff=0
rcvbuf_errors=0
rcvbuf_errors_diff=0
in_octets=0
in_octets_diff=0
out_octets=0
out_octets_diff=0

update_netstat() {
declare net_stat
Expand All @@ -39,13 +43,21 @@ update_netstat() {
stats=$(echo "$net_stat" | awk 'BEGIN {tmp_var = 0} /RcvbufErrors/ {tmp_var = $2} END { print tmp_var }')
rcvbuf_errors_diff=$((stats - rcvbuf_errors))
rcvbuf_errors="$stats"

stats=$(echo "$net_stat" | awk 'BEGIN {tmp_var = 0} /InOctets/ {tmp_var = $2} END { print tmp_var }')
in_octets_diff=$((stats - in_octets))
in_octets="$stats"

stats=$(echo "$net_stat" | awk 'BEGIN {tmp_var = 0} /OutOctets/ {tmp_var = $2} END { print tmp_var }')
out_octets_diff=$((stats - out_octets))
out_octets="$stats"
}

update_netstat

while true; do
update_netstat
report="packets_sent=$packets_sent_diff,packets_received=$packets_received_diff,receive_errors=$receive_errors_diff,rcvbuf_errors=$rcvbuf_errors_diff"
report="packets_sent=$packets_sent_diff,packets_received=$packets_received_diff,receive_errors=$receive_errors_diff,rcvbuf_errors=$rcvbuf_errors_diff,in_octets=$in_octets_diff,out_octets=$out_octets_diff"

echo "$report"
./metrics-write-datapoint.sh "net-stats,hostname=$HOSTNAME $report"
Expand Down
10 changes: 10 additions & 0 deletions src/broadcast_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ use counter::Counter;
use entry::Entry;
#[cfg(feature = "erasure")]
use erasure;
use influx_db_client as influxdb;
use leader_scheduler::LeaderScheduler;
use ledger::Block;
use log::Level;
use metrics;
use packet::SharedBlobs;
use rayon::prelude::*;
use result::{Error, Result};
Expand Down Expand Up @@ -151,6 +153,14 @@ fn broadcast(
num_entries, to_blobs_elapsed, chunking_elapsed, broadcast_elapsed
);

metrics::submit(
influxdb::Point::new("broadcast-stage")
.add_field(
"transmit-index",
influxdb::Value::Integer(transmit_index.data as i64),
).to_owned(),
);

Ok(())
}

Expand Down
9 changes: 9 additions & 0 deletions src/window_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,15 @@ pub fn window_service(
}
}

metrics::submit(
influxdb::Point::new("window-stage")
.add_field(
"host",
influxdb::Value::String(hostname().unwrap_or_else(|_| "?".to_string())),
).add_field("consumed", influxdb::Value::Integer(consumed as i64))
.to_owned(),
);

if received <= consumed {
trace!(
"{} we have everything received:{} consumed:{}",
Expand Down