Results 1 to 15 of 15

Thread: QHttp::dataSendProgress transfer speed Kb sec.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    Quote Originally Posted by wysota View Post
    Have you taken into consideration that the size pos() returns doesn't mean the position of the stream being sent but rather the one being read from the file? There is also some amount of data that is currently buffered along the way (file buffer, socket buffer, system buffer, NIC buffer, possibly more).

    I suppose QIODevice read fast or not fast in to speed tat socket can send....
    on dataSendProgress(int done , int) on done is 3% the same value as QIODevice :: pos() at end is the same .... but QIODevice :: pos() go moore as 2GB....


    And How calculate you the Time to complete upload? && Speed?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    Quote Originally Posted by patrik08 View Post
    And How calculate you the Time to complete upload? && Speed?
    speed = (length*percentage_completed) / time_elapsed
    time remaining = (1 - percentage_completed) * length/speed or 100*(1-percentage_completed)*time_elapsed
    percentage_completed = done/total (taken from QHttp progress signals)

    division used here (/) is a floating point operator.

    Example:

    length = 1000000B
    time_elapsed = 5s
    done = 1000
    total = 100000

    hence:
    percentage_completed = 0.01 (=10000B)
    speed = (10^6*10^-2)/5s = 10000/5 = 2000B/s
    time remaining = (1-0.01) * 10^6/2000 = 0.99 * 500 = 495s
    time remaining (alternative) = 100 * 0.99 * 5 = 99 * 5 = 495s


    BTW. 1% * 3GB = 3MB - buffers are not that large therefore you won't notice a difference with such big values here. But if you try sending a small file (100kB) through an extremely slow link, the file read buffer and socket write buffer positions might be quite different.

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    Quote Originally Posted by wysota View Post
    speed = (length*percentage_completed) / time_elapsed

    division used here (/) is a floating point operator.
    different.
    double can go to .arg(22.22) or accept .arg float as double?
    not run....
    QString str = QString("speed Kb/s: %1").arg(d, 0, 'f', 0);

    How can .arg() print only 2 decimal??
    QChar & fillChar 0

    Qt Code:
    1. double d = 12.34;
    2. QString str = QString("delta: %1").arg(d, 0, 'E', 3);
    3. // str == "delta: 1.234E+01"
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    I don't understand the question.

  5. #5
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    Quote Originally Posted by wysota View Post
    I don't understand the question.
    How display decimal numer on .arg ....?

    double nummer = .33 ;

    QString("Cent: %1").arg(nummer); /* comming 0 */

    QString str = QString("delta: %1").arg(d, 0, 'E', 3);
    i am confused on E g f..... i can only display decimal point on console app...
    and i like display double nummer = .33 on .arg() ....

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    Are you sure "nummer" is double? Or maybe you're using a comma instead of a dot while initialising the variable?

    The following:
    Qt Code:
    1. #include <QString>
    2. #include <QtDebug>
    3.  
    4. int main(){
    5. qDebug() << QString("Value: %1").arg((double).33);
    6. return 0;
    7. }
    To copy to clipboard, switch view to plain text mode 

    returns:
    "Value: 0.33"

  7. The following user says thank you to wysota for this useful post:

    patrik08 (6th March 2007)

  8. #7
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QHttp::dataSendProgress transfer speed Kb sec.

    Quote Originally Posted by wysota View Post
    Are you sure "nummer" is double? Or maybe you're using a comma instead of a dot while initialising the variable?

    The following:
    Qt Code:
    1. #include <QString>
    2. #include <QtDebug>
    3.  
    4. int main(){
    5. qDebug() << QString("Value: %1").arg((double).33);
    6. return 0;
    7. }
    To copy to clipboard, switch view to plain text mode 

    returns:
    is a float speed kbs .... convertet on double the first value .... why? .... on wayting the first second to calculate the speed upload..... to display speed each millisecond break my eyes && compiler... ... and i print only speed each sec. much tanks...

Similar Threads

  1. transfer large files using qsocket
    By vishesh in forum Qt Programming
    Replies: 3
    Last Post: 2nd March 2007, 15:40
  2. Speed of static app
    By jcr in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2006, 20:09
  3. How to get qtdemo with reasonable speed?
    By ponto in forum General Discussion
    Replies: 8
    Last Post: 31st May 2006, 10:25
  4. Speed penalty when using RTTI?
    By pir in forum General Programming
    Replies: 5
    Last Post: 19th May 2006, 00:36
  5. A way to transfer info from .pro to Makefile
    By thawkins in forum Qt Programming
    Replies: 3
    Last Post: 2nd May 2006, 21:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.