[SNMP4J] Statistics about number of retries and snmp request times

Frank Fock fock at agentpp.com
Sat Jan 23 11:06:36 CET 2016


Hi Michal,
This is a very good idea. I missed it yet, because I  only thought about the standard SNMP
message counters, which do not include retries and response times. 
I will add that for the next release (soon to come because of two other bug reports).

Best regards,
Frank



> On 22 Jan 2016, at 10:05, MichaƂ Steiner <mist at mist.pl> wrote:
> 
> Hi,
> 
> I'm looking for  a way to gather detailed statistics about SNMP
> communication (number of retries and exact times).
> SNMP4j supports  re-sending request if response didn't come within timeout
> limit which is very useful feature but it can mask some issues existing in
> the network. For example when there is a lot of retries because we are
> loosing some pockets, it will not be obviously visible. To find out how
> many retries was required you need to measure time between send request and
> getting response then depending on your TimeOutModel you need make some
> calculations.
> 
> This approach is not very useful because:
> - calculations may not be accurate  because we measure time of whole
> message handling not sending single PDU
> - you will need to modify all places in your code where you calling SNMP4j
> send method. It could be many of them.
> 
> Much better would be have possibility to get such info from Snmp class. For
> example you could add request  listener to the Snmp, and  in
> PendingRequest#responseReceived() method notify it about received
> response, something like this:
> 
> public void responseReceived() {
> 
> requestListener.onResponseReceived(
> target.getAddress(), //ip address
> pdu.getType(),  //get get-next etc
> pdu.size(),  //how many oids
> (System.nanoTime() - startedInNano) /
> SnmpConstants.MILLISECOND_TO_NANOSECOND ,  //how many ms was from creation
> of thiss PendingRequest till getting response
> target.getRetries() - retryCount);//how many retries
> 
> this.responseReceived = true;
> ...
> 
>  public interface RequestListener{
>    void onResponseReceived(Address address,int type, int size, long
> durationInMs, int retries);
>  }
> 
> 
> 
> Passing this request listener would be optional. It would be useful to have
> also info about request without response and cancelled.
> 
> Do you think it is good approach ?
> 
> Maybe you have other ideas how to gather such data?
> 
> Best Regards
> Michal
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j




More information about the SNMP4J mailing list