@@ -57,7 +57,7 @@ protected function setup(Options $options)
5757
5858 $ options ->registerCommand ('chat ' , 'Start an interactive chat session ' );
5959
60- $ options ->registerCommand ('info ' , 'Get Info about the vector storage ' );
60+ $ options ->registerCommand ('info ' , 'Get Info about the vector storage and other stats ' );
6161
6262 $ options ->registerCommand ('split ' , 'Split a page into chunks (for debugging) ' );
6363 $ options ->registerArgument ('page ' , 'The page to split ' , true , 'split ' );
@@ -120,7 +120,11 @@ protected function showinfo()
120120 $ stats = [
121121 'model ' => $ this ->getConf ('model ' ),
122122 ];
123- $ stats = array_merge ($ stats , $ this ->helper ->getStorage ()->statistics ());
123+ $ stats = array_merge (
124+ $ stats ,
125+ array_map ('dformat ' , $ this ->helper ->getRunData ()),
126+ $ this ->helper ->getStorage ()->statistics ()
127+ );
124128 $ this ->printTable ($ stats );
125129 }
126130
@@ -137,14 +141,14 @@ protected function printTable($data, $level = 0)
137141 foreach ($ data as $ key => $ value ) {
138142 if (is_array ($ value )) {
139143 echo $ tf ->format (
140- [$ level * 2 , 15 , '* ' ],
144+ [$ level * 2 , 20 , '* ' ],
141145 ['' , $ key , '' ],
142146 [Colors::C_LIGHTBLUE , Colors::C_LIGHTBLUE , Colors::C_LIGHTBLUE ]
143147 );
144148 $ this ->printTable ($ value , $ level + 1 );
145149 } else {
146150 echo $ tf ->format (
147- [$ level * 2 , 15 , '* ' ],
151+ [$ level * 2 , 20 , '* ' ],
148152 ['' , $ key , $ value ],
149153 [Colors::C_LIGHTBLUE , Colors::C_LIGHTBLUE , Colors::C_LIGHTGRAY ]
150154 );
@@ -259,6 +263,10 @@ protected function runMaintenance()
259263 $ this ->helper ->getStorage ()->runMaintenance ();
260264 $ this ->notice ('Peak memory used: {memory} ' , ['memory ' => filesize_h (memory_get_peak_usage (true ))]);
261265 $ this ->notice ('Spent time: {time}min ' , ['time ' => round ((time () - $ start ) / 60 , 2 )]);
266+
267+ $ data = $ this ->helper ->getRunData ();
268+ $ data ['maintenance ran at ' ] = time ();
269+ $ this ->helper ->setRunData ($ data );
262270 }
263271
264272 /**
@@ -274,6 +282,10 @@ protected function createEmbeddings($clear)
274282 $ this ->helper ->getEmbeddings ()->createNewIndex ($ skipRE , $ matchRE , $ clear );
275283 $ this ->notice ('Peak memory used: {memory} ' , ['memory ' => filesize_h (memory_get_peak_usage (true ))]);
276284 $ this ->notice ('Spent time: {time}min ' , ['time ' => round ((time () - $ start ) / 60 , 2 )]);
285+
286+ $ data = $ this ->helper ->getRunData ();
287+ $ data ['embed ran at ' ] = time ();
288+ $ this ->helper ->setRunData ($ data );
277289 }
278290
279291 /**
0 commit comments