@@ -170,6 +170,11 @@ class TDiagnoseFilesystemCommand final: public TFileStoreCommand
170170 TVector<TNodeRow>& accessRows,
171171 TVector<NAggregation::TRow<TLatency>>& latencyRows)
172172 {
173+ if (BatchSize == 0 ) {
174+ STORAGE_THROW_SERVICE_ERROR (
175+ MakeError (E_ARGUMENT , " batch-size must be greater than zero" ));
176+ }
177+ size_t completed = 0 ;
173178 for (int batchStart = 0 ; batchStart < shardStats.size ();
174179 batchStart += BatchSize)
175180 {
@@ -214,7 +219,8 @@ class TDiagnoseFilesystemCommand final: public TFileStoreCommand
214219 << result.GetOutput ())));
215220 continue ;
216221 }
217-
222+ ++completed;
223+ PrintProgress (completed, shardStats.size ());
218224 ProcessAccessStats (response.GetNodeStats (), accessRows);
219225 ProcessLatencyStats (response.GetLatencyStats (), latencyRows);
220226 }
@@ -238,6 +244,25 @@ class TDiagnoseFilesystemCommand final: public TFileStoreCommand
238244 std::move (request));
239245 }
240246
247+ void PrintProgress (size_t completed, size_t total)
248+ {
249+ if (JsonOutput) {
250+ return ;
251+ }
252+
253+ size_t width = 40 ;
254+ size_t filled = total ? completed * width / total : width;
255+
256+ Cout << ' \r ' << " Collecting access and latency stats ["
257+ << TString (filled, ' #' ) << TString (width - filled, ' _' ) << " ] "
258+ << completed << ' /' << total
259+ << Flush;
260+
261+ if (completed == total) {
262+ Cout << Endl;
263+ }
264+ }
265+
241266 void ProcessAccessStats (
242267 const google::protobuf::RepeatedPtrField<
243268 NCloud::NFileStore::NProtoPrivate::TNodeStats>& accessStats,
0 commit comments