@@ -477,7 +477,9 @@ public void indexDvObject(DvObject objectIn) throws SolrServerException, IOExce
477477
478478 public void indexDataset (Dataset dataset , boolean doNormalSolrDocCleanUp ) throws SolrServerException , IOException {
479479 doIndexDataset (dataset , doNormalSolrDocCleanUp );
480+ logger .info ("indexed dataset " + dataset .getId ());
480481 updateLastIndexedTime (dataset .getId ());
482+ logger .info ("indextime updated for dataset " + dataset .getId ());
481483 }
482484
483485 private void doIndexDataset (Dataset dataset , boolean doNormalSolrDocCleanUp ) throws SolrServerException , IOException {
@@ -917,7 +919,13 @@ private IndexResponse indexDatasetPermissions(Dataset dataset) {
917919 */
918920 return new IndexResponse ("permissions indexing disabled for debugging" );
919921 }
922+ long startTime = System .currentTimeMillis ();
920923 IndexResponse indexResponse = solrIndexService .indexPermissionsOnSelfAndChildren (dataset );
924+ long endTime = System .currentTimeMillis ();
925+ long duration = endTime - startTime ;
926+
927+ logger .info ("Indexing permissions for dataset " + dataset .getId () + " took " + duration + " ms" );
928+
921929 return indexResponse ;
922930 }
923931
@@ -927,6 +935,7 @@ private String addOrUpdateDataset(IndexableDataset indexableDataset) throws Sol
927935 }
928936
929937 public SolrInputDocuments toSolrDocs (IndexableDataset indexableDataset , Set <Long > datafilesInDraftVersion ) throws SolrServerException , IOException {
938+
930939 try {
931940 IndexableDataset .DatasetState state = indexableDataset .getDatasetState ();
932941 Dataset dataset = indexableDataset .getDatasetVersion ().getDataset ();
@@ -1411,7 +1420,10 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
14111420 dataset .getCitation (dataset .getReleasedVersion ()) : dataset .getCitation ();
14121421 final Long datasetId = dataset .getId ();
14131422 final String datasetGlobalId = dataset .getGlobalId ().toString ();
1423+ long totalLoopTime = 0 ;
14141424 for (FileMetadata fileMetadata : fileMetadatas ) {
1425+ long startTime = System .currentTimeMillis ();
1426+
14151427 LocalDate end = null ;
14161428 LocalDate start = null ;
14171429 Embargo emb = fileMetadata .getDataFile ().getEmbargo ();
@@ -1759,7 +1771,12 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
17591771 filesIndexed .add (fileSolrDocId );
17601772 docs .add (datafileSolrInputDocument );
17611773 }
1774+ long endTime = System .currentTimeMillis ();
1775+ long duration = endTime - startTime ;
1776+ totalLoopTime += duration ;
1777+ logger .info ("Processed fileMetadata " + fileMetadata .getId () + " in " + duration + " ms" );
17621778 }
1779+ logger .info ("Processed all " + fileMetadatas .size () + " fileMetadatas in " + totalLoopTime + " ms" );
17631780 if (embargoEndDate !=null ) {
17641781 solrInputDocument .addField (SearchFields .EMBARGO_END_DATE , embargoEndDate .toEpochDay ());
17651782 }
@@ -1782,7 +1799,13 @@ private String addOrUpdateDataset(IndexableDataset indexableDataset, Set<Long> d
17821799 final SolrInputDocuments docs = toSolrDocs (indexableDataset , datafilesInDraftVersion );
17831800
17841801 try {
1802+ long startTime = System .currentTimeMillis ();
1803+ int docCount = docs .getDocuments ().size ();
1804+ logger .info ("Starting to add " + docCount + " documents to Solr" );
17851805 solrClientIndexService .getSolrClient ().add (docs .getDocuments ());
1806+ long endTime = System .currentTimeMillis ();
1807+ long duration = endTime - startTime ;
1808+ logger .info ("Finished adding " + docCount + " documents to Solr. Time taken: " + duration + " ms" );
17861809 } catch (SolrServerException | IOException ex ) {
17871810 logger .warning ("Check process-failures logs re: " + ex .getLocalizedMessage ());
17881811 if (ex .getCause () instanceof SolrServerException ) {
0 commit comments