@ -25,6 +25,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import java.io.IOException ;
import net.yacy.cora.protocol.RequestHeader ;
import net.yacy.cora.util.Memory ;
import net.yacy.crawler.CrawlSwitchboard ;
@ -36,6 +38,8 @@ import net.yacy.kelondro.workflow.WorkflowProcessor;
import net.yacy.search.Switchboard ;
import net.yacy.search.SwitchboardConstants ;
import net.yacy.search.index.Segment ;
import net.yacy.search.schema.CollectionSchema ;
import net.yacy.search.schema.WebgraphSchema ;
import net.yacy.server.serverObjects ;
import net.yacy.server.serverSwitch ;
@ -77,6 +81,8 @@ public class status_p {
prop . putNum ( "urlpublictextSegmentCount" , segment . fulltext ( ) . getDefaultConnector ( ) . getSegmentCount ( ) ) ;
prop . putNum ( "webgraphSize" , segment . fulltext ( ) . writeToWebgraph ( ) ? segment . fulltext ( ) . webgraphSize ( ) : 0 ) ;
prop . putNum ( "webgraphSegmentCount" , segment . fulltext ( ) . writeToWebgraph ( ) ? segment . fulltext ( ) . getWebgraphConnector ( ) . getSegmentCount ( ) : 0 ) ;
prop . putNum ( "citationSize" , segment . citationCount ( ) ) ;
prop . putNum ( "citationSegmentCount" , segment . citationSegmentCount ( ) ) ;
prop . putNum ( "rwipublictextSize" , segment . RWICount ( ) ) ;
prop . putNum ( "rwipublictextSegmentCount" , segment . RWISegmentCount ( ) ) ;
@ -123,6 +129,38 @@ public class status_p {
prop . put ( "postprocessingRunning" , Switchboard . postprocessingRunning ? 1 : 0 ) ;
boolean processCollection = sb . index . fulltext ( ) . getDefaultConfiguration ( ) . contains ( CollectionSchema . process_sxt ) & & ( sb . index . connectedCitation ( ) | | sb . index . fulltext ( ) . writeToWebgraph ( ) ) ;
boolean processWebgraph = sb . index . fulltext ( ) . getWebgraphConfiguration ( ) . contains ( WebgraphSchema . process_sxt ) & & sb . index . fulltext ( ) . writeToWebgraph ( ) ;
long collectionTimeSinceStart = processCollection & & Switchboard . postprocessingRunning ? System . currentTimeMillis ( ) - Switchboard . postprocessingStartTime [ 0 ] : 0 ;
long webgraphTimeSinceStart = processWebgraph & & Switchboard . postprocessingRunning ? System . currentTimeMillis ( ) - Switchboard . postprocessingStartTime [ 1 ] : 0 ;
long collectionRemainingCount = 0 ;
if ( processCollection ) try { collectionRemainingCount = sb . index . fulltext ( ) . getDefaultConnector ( ) . getCountByQuery ( CollectionSchema . process_sxt . getSolrFieldName ( ) + ":[* TO *]" ) ; } catch ( IOException e ) { }
long collectionCountSinceStart = Switchboard . postprocessingRunning ? Switchboard . postprocessingCount [ 0 ] - collectionRemainingCount : 0 ;
int collectionSpeed = collectionTimeSinceStart = = 0 ? 0 : ( int ) ( 60000 * collectionCountSinceStart / collectionTimeSinceStart ) ; // pages per minute
long collectionRemainingTime = collectionSpeed = = 0 ? 0 : 60000 * collectionRemainingCount / collectionSpeed ; // millis
int collectionRemainingTimeMinutes = ( int ) ( collectionRemainingTime / 60000 ) ;
int collectionRemainingTimeSeconds = ( int ) ( ( collectionRemainingTime - ( collectionRemainingTimeMinutes * 60000 ) ) / 1000 ) ;
prop . put ( "postprocessingCollectionRemainingCount" , collectionRemainingCount ) ;
prop . put ( "postprocessingRunning_collectionSpeed" , collectionSpeed ) ;
prop . put ( "postprocessingRunning_collectionRemainingTimeMinutes" , collectionRemainingTimeMinutes ) ;
prop . put ( "postprocessingRunning_collectionRemainingTimeSeconds" , collectionRemainingTimeSeconds ) ;
long webgraphRemainingCount = 0 ;
if ( processWebgraph ) try { webgraphRemainingCount = sb . index . fulltext ( ) . getWebgraphConnector ( ) . getCountByQuery ( WebgraphSchema . process_sxt . getSolrFieldName ( ) + ":[* TO *]" ) ; } catch ( IOException e ) { }
long webgraphCountSinceStart = Switchboard . postprocessingRunning ? Switchboard . postprocessingCount [ 1 ] - webgraphRemainingCount : 0 ;
int webgraphSpeed = webgraphTimeSinceStart = = 0 ? 0 : ( int ) ( 60000 * webgraphCountSinceStart / webgraphTimeSinceStart ) ; // pages per minute
long webgraphRemainingTime = webgraphSpeed = = 0 ? 0 : 60000 * webgraphRemainingCount / webgraphSpeed ; // millis
int webgraphRemainingTimeMinutes = ( int ) ( webgraphRemainingTime / 60000 ) ;
int webgraphRemainingTimeSeconds = ( int ) ( ( webgraphRemainingTime - ( webgraphRemainingTimeMinutes * 60000 ) ) / 1000 ) ;
prop . put ( "postprocessingWebgraphRemainingCount" , webgraphRemainingCount ) ;
prop . put ( "postprocessingRunning_webgraphSpeed" , webgraphSpeed ) ;
prop . put ( "postprocessingRunning_webgraphRemainingTimeMinutes" , webgraphRemainingTimeMinutes ) ;
prop . put ( "postprocessingRunning_webgraphRemainingTimeSeconds" , webgraphRemainingTimeSeconds ) ;
// return rewrite properties
return prop ;
}