| To: | pcp@xxxxxxxxxxx |
|---|---|
| Subject: | %ifutil |
| From: | Michele Baldessari <michele@xxxxxxxxxx> |
| Date: | Wed, 3 Dec 2014 22:57:21 +0100 |
| Delivered-to: | pcp@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/simple; d=acksyn.org; h= user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:from:from:date:date :received:received; s=2010; t=1417643842; bh=IZP3kTA11NTb4TWktfA 5TJuUem2BElQ3HCpnU3mHKAE=; b=GXRLCxTsj4vvXTfQCOfiHq8repmJ3pbqSvk OG8d3mgqP93YUaVOmpX2I7/rQUaz030aDklEfmmofjUiBwMusrS461nzZXElzaTn ulGK1Cy839n02yaZGfCyipMJAKriPySxQ5dQZSZLz7SIb7+rvHMVq/IWc+GUcs17 KvppEE1U= |
| User-agent: | Mutt/1.5.21 (2012-12-30) |
Hi folks,
I am slowly working on replacing all our internal scripts to collect network
statistics. One value that sar gives out is %ifutil, which is defined as
follows:
"""
Utilization percentage of the network interface. For half-duplex interfaces,
utilization is calculated using the sum of rxkB/s and txkB/s as a percentage
of the interface speed. For full-duplex, this is the greater of rxkB/S or
txkB/s.
"""
Code:
double compute_ifutil(struct stats_net_dev *st_net_dev, double rx, double tx)
{
unsigned long long speed;
if (st_net_dev->speed) {
speed = st_net_dev->speed * 1000000;
if (st_net_dev->duplex == C_DUPLEX_FULL) {
/* Full duplex */
if (rx > tx) {
return (rx *
800 / speed);
}
else {
return (tx *
800 / speed);
}
}
else {
/* Half duplex */
return ((rx + tx) * 800 /
speed);
}
}
return 0;
}
Two questions:
1) Would it be ok to add this to the Linux PMDA or do you feel this is
something to be taken care of
by higher-level apps/tools or via some combined metric?
2) In case the answer to 1) is 'it is ok', is the above calculation ok? I'm not
entirely convinced.
I'd personally split it in %rx_ifutil and %tx_ifutil. Thoughts?
Cheers,
Michele
--
Michele Baldessari <michele@xxxxxxxxxx>
C2A5 9DA3 9961 4FFB E01B D0BC DDD4 DCCB 7515 5C6D
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] Fix the description of few network metrics and expand some others, Michele Baldessari |
|---|---|
| Next by Date: | Networking Metrics, Michele Baldessari |
| Previous by Thread: | [PATCH] Fix the description of few network metrics and expand some others, Michele Baldessari |
| Next by Thread: | Re: [pcp] %ifutil, Nathan Scott |
| Indexes: | [Date] [Thread] [Top] [All Lists] |