Beispiel #1
0
        public ReportResponse getResult()
        {
            var resp = new ReportResponse();
            resp.Totals.Add(new KeyValuePair<string, string>("Total file count", _fileCount.ToString()));
            resp.Totals.Add(new KeyValuePair<string, string>("Total directory count", _directoryCount.ToString()));
            resp.Totals.Add(new KeyValuePair<string, string>("Total size", InOut.humanizeFilesize(_totalSize, !_rq.RawSizeFormat)));
            resp.Totals.Add(new KeyValuePair<string, string>("Total running time", InOut.humanizeSeconds(_rq.Timer.Elapsed)));

            return resp;
        }
Beispiel #2
0
        public dsr.Report.StateModel.ReportResponse getResult()
        {
            var resp = new StateModel.ReportResponse();
            resp.Name = "Top file count";

            resp.Members = _hash
                .AsEnumerable()
                .OrderByDescending(x => x.Value)
                .Take((int)_limit)
                .Select(x => new StateModel.ReportResponseMember(x.Key, InOut.humanizeCount(x.Value, !_rq.RawSizeFormat)))
                .ToList();

            return resp;
        }