Project

General

Profile

Actions

bug #6086

closed

Percentage value in ProgressMonitor accuratly rounded

Added by Andreas Kohlbecker over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Severity:
normal
Found in Version:

Description

The percentage value on the progress of the indexing process is often reported as 99,99% when the job is completet.
The commit commit:cdm|1ec5d31 (better percentage values from Progressmonitor) should fix that but the problem is not fully solved.

a.muller wote:

beim Indexieren könnte man auch folgendes noch runden: indexing DescriptionElementBase [chunk 3.168351341931038/6]

Ausserdem ist das Endergebnis immer noch nicht immer 100%, sondern diesmal z.B. 100.01%. Math.ceil ist noch nicht ganz die richtige Funktion.

Ich verwende ja in letzter Zeit immer mehr BigDecimal, da ist das viel klarer definiert. Vielleicht sollten wir den ProgressMonitor mal diesbezöglich anpassen.

Actions #1

Updated by Andreas Müller over 6 years ago

Ceil is not the correct method, use round instead, otherwise the result is only rounded into one direction.

Actions #2

Updated by Andreas Müller over 6 years ago

  • Category changed from cdm to cdmlib

Experience shows (see class DefaultProgressMonitorTest) that rounding errors mostly appear when SubProgressMonitors are in use due to the intermediate results stored in "workDone".

To avoid this I kept the rounding but with more digits (5).

Also I added a new method that allows user defined rounding using BigDecimal and scaling.

cdmlib|6f5969

Actions #3

Updated by Andreas Müller over 6 years ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • Target version changed from Unassigned CDM tickets to Release 4.3

Can you please check if this fixes the problem?

Actions #4

Updated by Andreas Kohlbecker over 6 years ago

  • Status changed from New to Closed

This seems to be fully solved.

Actions

Also available in: Atom PDF