Script shell calculate mean arrival request duration | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Script shell calculate mean arrival request duration

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-28-2013
Amouna Amouna is offline
Registered User
 
Join Date: Aug 2013
Last Activity: 29 August 2013, 8:55 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Script shell calculate mean arrival request duration

hello,
I have implemented this command :

Code:
tshark -eth0 -T fiels -e frame.time et sip.Request-Line -z sip,stat > test2.txt

the result of this command : test.txt:

Code:
Aug 27, 2013 23:06:47.334270000	INVITE	
Aug 27, 2013 23:06:47.335045000	 SIP/2.0 401 Unauthorized 
Aug 27, 2013 23:06:47.336897000	ACK	
Aug 27, 2013 23:06:47.350187000	INVITE	
Aug 27, 2013 23:06:47.351728000	 SIP/2.0 100 Trying 
Aug 27, 2013 23:06:47.354311000	INVITE	
Aug 27, 2013 23:06:47.500954000	 SIP/2.0 180 Ringing 
Aug 27, 2013 23:06:47.504776000	 SIP/2.0 180 Ringing 
Aug 27, 2013 23:06:48.415368000	CANCEL	
Aug 27, 2013 23:06:48.416001000	 SIP/2.0 487 Request Terminated 
Aug 27, 2013 23:06:48.416193000	 SIP/2.0 200 OK 
Aug 27, 2013 23:06:48.416522000	CANCEL	
Aug 27, 2013 23:06:48.424779000	ACK	
Aug 27, 2013 23:06:48.590352000	 SIP/2.0 200 OK 
Aug 27, 2013 23:06:48.590370000	 SIP/2.0 487 Request Terminated 
Aug 27, 2013 23:06:48.595704000	ACK

so this file presents the arrival time and the name of the request or response of the sip protocol.
my purpose is to calculate :
1) the mean time duration of request = sum ( arrival_time_current_request - arrival_time_previous-request) / ( total number of request)

given that a sip request can be : ack, invite,cancel

1) I will repeat the same think with response :the mean time duration of response = sum ( arrival_time_current_resonset - arrival_time_previous-response) / ( total number of response)


given that a sip response can be : 180Ringing,200ok....etc

Thanks you.

---------- Post updated at 09:34 AM ---------- Previous update was at 06:49 AM ----------


Please how can help me ?

Last edited by Scott; 08-28-2013 at 09:18 AM.. Reason: Please use code tags
Sponsored Links
    #2  
Old 09-04-2013
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
 
Join Date: Nov 2007
Last Activity: 14 December 2014, 8:48 PM EST
Location: New Zealand
Posts: 1,048
Thanks: 21
Thanked 26 Times in 25 Posts
To assist us in this, try breaking the problem up a bit - I can't spek fo the others here but I'm reluctant to expend a bunch of energy understanding how that packet dump format works and what the chain of events should be.

What specific questions do you have?
Are you having trouble making a script that identifies which lines in the output make up one 'conversation'? (If so, list what one conversation would look like and then show it in the larger output)
Are you having trouble scripting the maths to calculate the time differences? (If so, show exactly what values you are trying to perform the maths on).

Sorry I can't help more yet but you should find plenty of assistance once the problem is more clear.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Convert Date from File and Calculate Duration Newbie2012 Shell Programming and Scripting 5 05-08-2012 10:04 PM
Shell script request udayakumar Shell Programming and Scripting 5 04-02-2012 02:31 PM
date duration fail to calculate jimmy_y Shell Programming and Scripting 2 08-25-2009 04:15 AM
shell script to get the arrival count of file RSC1985 Shell Programming and Scripting 2 08-20-2009 05:49 AM
need to invoke a script upon arrival of a file sais Shell Programming and Scripting 2 12-26-2008 05:54 AM



All times are GMT -4. The time now is 11:04 AM.