Opened 10 years ago

Closed 10 years ago

#4661 closed Enhancement (worksforme)

show hashfails as function of corrupt blocks / piece size

Reported by: cfpp2p Owned by:
Priority: Lowest Milestone: None Set
Component: Web Client Version: 2.42
Severity: Trivial Keywords:
Cc:

Description

show hashfails as function of corrupt blocks / piece size

. . . .

Index: inspector.js
===================================================================
--- inspector.js	(revision 13103)
+++ inspector.js	(working copy)
@@ -201,13 +201,19 @@
         if(torrents.length < 1)
             str = none;
         else {
-            d = f = 0;
+            d = f = pieces = 0;
             for(i=0; t=torrents[i]; ++i) {
                 d = t.getDownloadedEver();
                 f = t.getFailedEver();
+                pieceSize = t.getPieceSize()
+                if(pieceSize > 0)
+                   pieces = Math.round(f / pieceSize);
             }
             if(f)
-                str = fmt.size(d) + ' (' + fmt.size(f) + ' corrupt)';
+               if(pieces)
+                  str = fmt.size(d) + ' (' + fmt.size(f) + ' wasted from ' + pieces + ' hashfail(s) )';
+               else
+                  str = fmt.size(d) + ' (' + fmt.size(f) + ' wasted)';
             else
                 str = fmt.size(d);
         }

Attachments (1)

hashfails.patch (972 bytes) - added by cfpp2p 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by cfpp2p

comment:1 Changed 10 years ago by jordan

This patch is making assumptions about how many pieces were involved. From the RPC information given, we don't know how many pieces got a corrupt block.

What is the goal of this enhancement?

comment:2 Changed 10 years ago by cfpp2p

(?assumptions?) a particular torrent's: block size = piece size, I didn't think there was a difference.

Hash check must be performed on block(piece) after it's completely downloaded. Therefore getFailedEver would only be a multiple of getPieceSize.

Goal is to show how many hash check fails occurred for the particular torrent. This should be the same as how many pieces were involved: block size = piece size.

If I'm in error about block size please provide me information about block size and I'll code an updated patch.

comment:3 Changed 10 years ago by jordan

piece size is usually a multiple of block size.

I'm not really sure what advantage this gives over saying how many KB of data were thrown out because of checksum failures?

comment:4 Changed 10 years ago by cfpp2p

my fault, my initial description is off.

description should just say 'show number of hashfails for each torrent'

. .

show hashfails as function of:

particular torrent's -->

(TOTAL downloaded bytes corrupt) / (piece size in bytes)

sorry for the confusion, just trying to make it simple, but when simplicity reaches zero explanation reaches infinity...

I've bean using the patch and it works as I want. In web client inspector activity, view a downloading or completed torrent that has any hashfails and the downloaded information now shows how much wasted(corrupt) amount was downloaded and how many times (number of hashfails) a corrupt piece was downloaded.

comment:5 Changed 10 years ago by jordan

I appreciate your patch but I still have two major issues with this:

  1. I don't understand how this is more useful than knowing how many bytes were thrown out due to checksum fails.
  1. Even if knowing the number of pieces is useful, the count here is possibly not accurate. What if the same piece failed ten times? Should that be shown as 1 piece, or 10 pieces?

comment:6 Changed 10 years ago by cfpp2p

  • Resolution set to worksforme
  • Status changed from new to closed

I don't understand how this is more useful than knowing how many bytes were thrown out due to checksum fails.

it is usefull to me and I thought maybe others, simple and minimal impact on code

Even if knowing the number of pieces is useful, the count here is possibly not accurate. What if the same piece failed ten times? Should that be shown as 1 piece, or 10 pieces?

given

/** Byte count of all the corrupt data you've ever downloaded for
        this torrent. If you're on a poisoned torrent, this number can
        grow very large. */
    uint64_t    corruptEver;
getFailedEver: function(i) { return this.fields.corruptEver; },

f = t.getFailedEver()

pieces = Math.round(f / pieceSize);

is total fail count even if same piece fails multiple times

Note: See TracTickets for help on using tickets.