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

Include UDP sent packet statistics in net stats #1225

Merged
merged 1 commit into from
Sep 14, 2018

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Sep 14, 2018

No description provided.

@pgarg66 pgarg66 requested a review from mvines September 14, 2018 20:26
Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm starting to get a little worried about the N awk processes we're creating every second. Won't scale as N gets larger but fine until proven otherwise I guess

@pgarg66 pgarg66 merged commit d12537b into solana-labs:master Sep 14, 2018
@pgarg66 pgarg66 deleted the net-stats branch September 14, 2018 20:32
@@ -22,6 +24,10 @@ update_netstat() {
net_stat=$(netstat -suna)

declare stats
stats=$(echo "$net_stat" | awk 'BEGIN {tmp_var = 0} /packets sent/ {tmp_var = $1} END { print tmp_var }')
Copy link
Contributor

@rob-solana rob-solana Sep 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

netsnmp()
{
  # $1: section name, e.g. "udp"                                                                                                                                                                                                                                                   
  # $2-....: field names to query, e.g. "udp"                                                                                                                                                                                                                                      
  #  outputs field values in order                                                                                                                                                                                                                                                 
  declare -a names=( )
  declare -a values=( )
  declare section=$1

  shift

  while read -r -a line; do
    [[ ${line[0]} == "${section}:" ]] || continue
    names=( "${line[@]:1}" )
    read -r -a line
    values=( "${line[@]:1}" )
  done < /proc/net/snmp

  while [[ -n $1 ]]; do
    for ((i=0; i<${#names[*]}; i++)); do
      [[ ${names[i]} == "$1" ]] && echo "${values[i]}" && break
    done
    shift
  done
}
 

for your purposes:

packets_sent_diff=$(($(netsnmp Udp OutDatagrams) - packets_sent))

vkomenda pushed a commit to vkomenda/solana that referenced this pull request Aug 29, 2021
yihau pushed a commit that referenced this pull request May 14, 2024
… of #1106) (#1225)

reverts back in SocketAddr dedup in retransmit stage (#1106)

This was erronously deemed as unnecessary and removed in:
anza-xyz#864

The commit partially reverts #864 and adds back socket-addr dedup.

(cherry picked from commit fbe1dbc)

Co-authored-by: behzad nouri <[email protected]>
yihau pushed a commit to yihau/solana that referenced this pull request May 15, 2024
… of solana-labs#1106) (solana-labs#1225)

reverts back in SocketAddr dedup in retransmit stage (solana-labs#1106)

This was erronously deemed as unnecessary and removed in:
anza-xyz#864

The commit partially reverts solana-labs#864 and adds back socket-addr dedup.

(cherry picked from commit fbe1dbc)

Co-authored-by: behzad nouri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants