Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calculating Data being transfered  RSS feed

 
Nicky Formosa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm currently running my j2me app by emulating tru Eclipse. I would like to know if there is a way to simply calculate the amount of data is being transfered from my server to the app so that i can calculate cost eventually!?

Thanks all..

regards
Nick
 
Caius Jard
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working with MIDP1.0 and gthere isnt a way to find out the size of the request from the java side, but here's a thought:

The server is much more intelligent and powerful; It is perfectly capable of sizing the request, counting the bytes of the response, and then telling the midlet.. So basically I reckon you can get the server to do this?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. In many cases, this information can be extracted directly from the server log files.

Example:


This is actually a robot spidering the website (an infamous spammer, I think), but that's not important. What is is the numbers following the "200"s.

The "200"s are HTTP status codes, the numbers following them are the downloaded data size in bytes.

To count bytes going up to the server, look at the POST requests, which also have a length in bytes. For more accurate stats, look the the URLs of the GET requests and compute their string lengths.

I don't think I'm actually capturing transfers of headers and cookies, so the final tally may require figuring out the average overhead and adding it in.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... And yes, the robot.txt files really ARE only 1 byte long!

It's a hint to spiders NOT to do what they're doing and the mere presence of the file is a signal, so there's nothing in it but a single blank line (Unix-style).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!