You've already forked linux-packaging-mono
Imported Upstream version 6.6.0.89
Former-commit-id: b39a328747c2f3414dc52e009fb6f0aa80ca2492
This commit is contained in:
parent
cf815e07e0
commit
95fdb59ea6
23
external/api-doc-tools/mdoc/Mono.Documentation/Updater/Statistics/StatisticsSaver.cs
vendored
Normal file
23
external/api-doc-tools/mdoc/Mono.Documentation/Updater/Statistics/StatisticsSaver.cs
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.Documentation.Updater.Statistics
|
||||
{
|
||||
public static class StatisticsSaver
|
||||
{
|
||||
private const string DefaltStatisticsFileName = "statistics.txt";
|
||||
|
||||
/// <summary>
|
||||
/// Save statistics to the file
|
||||
/// </summary>
|
||||
/// <param name="statisticsCollector">Statistics values which should be saved</param>
|
||||
/// <param name="statisticsFilePath">Path to the file where statistics should be saved</param>
|
||||
public static void Save(StatisticsCollector statisticsCollector, string statisticsFilePath)
|
||||
{
|
||||
if (Directory.Exists(statisticsFilePath))
|
||||
statisticsFilePath = Path.Combine(statisticsFilePath, DefaltStatisticsFileName);
|
||||
File.WriteAllText(statisticsFilePath, StatisticsFormatter.Format(statisticsCollector.Storages));
|
||||
Console.WriteLine($"Statistics saved to {statisticsFilePath}");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user