Re: Obtaining SOLR index size on disk

2010-04-05 Thread Lance Norskog
This information is not available via the API. If you would like this
information added to the statistics request, please file a JIRA
requesting it.

Without knowing the size of the index files to be transferred, the
client cannot monitor its own disk space. This would be useful for the
cloud management features.

On Mon, Apr 5, 2010 at 5:35 AM, Na_D nabam...@zaloni.com wrote:

  hi,

   I am using the piece of code given below

          ReplicationHandler handler2 = new ReplicationHandler();
                 System.out.println( handler2.getDescription());


                 NamedList statistics = handler2.getStatistics();
                 System.out.println(Statistics   + statistics);

 The result that i am getting (ie the printed statment is :
 Statistics
 {handlerStart=1270469530218,requests=0,errors=0,timeouts=0,totalTime=0,avgTimePerRequest=NaN,avgRequestsPerSecond=NaN}


 But the Statistics consists of the other info too:

 class
        org.apache.solr.handler.ReplicationHandler
      /class
      version
        $Revision: 829682 $
      /version

      description
        ReplicationHandler provides replication of index and configuration
 files from Master to Slaves
      /description
      stats

        stat name=handlerStart 
          1270463612968
        /stat

        stat name=requests 
          0
        /stat

        stat name=errors 
          0
        /stat

        stat name=timeouts 
          0
        /stat

        stat name=totalTime 
          0
        /stat

        stat name=avgTimePerRequest 
          NaN
        /stat

        stat name=avgRequestsPerSecond 
          0.0
        /stat

        stat name=indexSize 
          19.29 KB
        /stat

        stat name=indexVersion 
          1266984293131
        /stat

        stat name=generation 
          3
        /stat

        stat name=indexPath 
          C:\solr\apache-solr-1.4.0\example\example-DIH\solr\db\data\index
        /stat

        stat name=isMaster 
          true
        /stat

        stat name=isSlave 
          false
        /stat

        stat name=confFilesToReplicate 
          schema.xml,stopwords.txt,elevate.xml
        /stat

        stat name=replicateAfter 
          [commit, startup]
        /stat

        stat name=replicationEnabled 
          true
        /stat

      /stats
    /entry



 this is where the problem lies : i need the size of the index im not finding
 the API
 nor is the statistics printing out(sysout) the same.
 how to i get the size of the index
 --
 View this message in context: 
 http://n3.nabble.com/Obtaining-SOLR-index-size-on-disk-tp500095p697599.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Lance Norskog
goks...@gmail.com


Re: Obtaining SOLR index size on disk

2010-04-05 Thread Na_D

  hi,
 
   I am using the piece of code given below
 
  ReplicationHandler handler2 = new ReplicationHandler();
 System.out.println( handler2.getDescription());
 
 
 NamedList statistics = handler2.getStatistics();
 System.out.println(Statistics   + statistics);

The result that i am getting (ie the printed statment is :
Statistics  
{handlerStart=1270469530218,requests=0,errors=0,timeouts=0,totalTime=0,avgTimePerRequest=NaN,avgRequestsPerSecond=NaN}


But the Statistics consists of the other info too:

class
org.apache.solr.handler.ReplicationHandler
  /class
  version
$Revision: 829682 $
  /version

  description
ReplicationHandler provides replication of index and configuration
files from Master to Slaves
  /description
  stats

stat name=handlerStart 
  1270463612968
/stat

stat name=requests 
  0
/stat

stat name=errors 
  0
/stat

stat name=timeouts 
  0
/stat

stat name=totalTime 
  0
/stat

stat name=avgTimePerRequest 
  NaN
/stat

stat name=avgRequestsPerSecond 
  0.0
/stat

stat name=indexSize 
  19.29 KB
/stat

stat name=indexVersion 
  1266984293131
/stat

stat name=generation 
  3
/stat

stat name=indexPath 
  C:\solr\apache-solr-1.4.0\example\example-DIH\solr\db\data\index
/stat

stat name=isMaster 
  true
/stat

stat name=isSlave 
  false
/stat

stat name=confFilesToReplicate 
  schema.xml,stopwords.txt,elevate.xml
/stat

stat name=replicateAfter 
  [commit, startup]
/stat

stat name=replicationEnabled 
  true
/stat

  /stats
/entry



this is where the problem lies : i need the size of the index im not finding
the API 
nor is the statistics printing out(sysout) the same.
how to i get the size of the index
-- 
View this message in context: 
http://n3.nabble.com/Obtaining-SOLR-index-size-on-disk-tp500095p697599.html
Sent from the Solr - User mailing list archive at Nabble.com.


Index size on disk

2010-03-11 Thread Tomas
Hello, I needed an easy way to see the index size (the actual size on disk, not 
just the number of documents indexed) and as i didn't found anything for doing 
that on the documentation or on the list, I coded a fast solution.

I added the Index size as a statistic of the searcher, that way the value can 
be seen on the statistics page of the Solr admin. To do this I modified the 
method 

public NamedList getStatistics() {... 

on the class 

org.apache.solr.search.SolrIndexSearcher

by adding the line

lst.add(indexSize, this.calculateIndexSize(reader.directory()).toString() +  
MB);

and added the methods: 

 private BigDecimal calculateIndexSize(Directory directory) {
  long size = 0L;
  try {
for(String filePath:directory.listAll()) {
size+=directory.fileLength(filePath);
  }
} catch (IOException e) {
return new BigDecimal(-1);
}
return getSizeInMB(size, 2);
  }

private BigDecimal getSizeInMB(long size, int scale) {
BigDecimal divisor = new BigDecimal(1024);
BigDecimal sizeKb = new BigDecimal(size).divide(divisor, scale + 1, 
BigDecimal.ROUND_HALF_UP);
return sizeKb.divide(divisor, scale, BigDecimal.ROUND_HALF_UP);
}

I'm running Solr 1.4 on a JBoss 4.0.5 with Java 1.5 and this worked just fine. 
Does anyone see a potential problem on this?

I'm assuming that the solr index will never have directories inside (that's why 
I'm just looping on the index parent directory), is there any case when this is 
not true?

Tomás



  Yahoo! Cocina

Encontra las mejores recetas con Yahoo! Cocina.


http://ar.mujer.yahoo.com/cocina/

Re: Obtaining SOLR index size on disk

2009-07-20 Thread Peter Wolanin
Actually, if you have a server enabled as a replication master, the
stats.jsp page reports the index size, so that information is
available in some cases.

-Peter

On Sat, Jul 18, 2009 at 8:14 AM, Erik Hatchere...@ehatchersolutions.com wrote:

 On Jul 17, 2009, at 8:45 PM, J G wrote:

 Is it possible to obtain the SOLR index size on disk through the SOLR API?
 I've read through the docs and mailing list questions but can't seem to find
 the answer.

 No, but it'd be a great addition to the /admin/system handler which returns
 lots of other useful trivia like the free memory, ulimit, uptime, and such.

        Erik





-- 
Peter M. Wolanin, Ph.D.
Momentum Specialist,  Acquia. Inc.
peter.wola...@acquia.com


Re: Obtaining SOLR index size on disk

2009-07-18 Thread Erik Hatcher


On Jul 17, 2009, at 8:45 PM, J G wrote:
Is it possible to obtain the SOLR index size on disk through the  
SOLR API? I've read through the docs and mailing list questions but  
can't seem to find the answer.


No, but it'd be a great addition to the /admin/system handler which  
returns lots of other useful trivia like the free memory, ulimit,  
uptime, and such.


Erik



Obtaining SOLR index size on disk

2009-07-17 Thread J G

Hello,

Is it possible to obtain the SOLR index size on disk through the SOLR API? I've 
read through the docs and mailing list questions but can't seem to find the 
answer.

Any help is appreciated.

Thanks.



_
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009