-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1311 from github/add-upload-archive-progress-repo…
…rt-for-aws-and-azure Add progress report when uploading migration archives to Azure Blob or AWS S3
- Loading branch information
Showing
10 changed files
with
187 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
- Add progress report to `gh [gei|bbs2gh] migrate-repo` command when uploading migration archives to Azure Blob or AWS S3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace OctoshiftCLI.Extensions; | ||
|
||
public static class NumericExtensions | ||
{ | ||
public static string ToLogFriendlySize(this long size) | ||
{ | ||
const int kilobyte = 1024; | ||
const int megabyte = 1024 * kilobyte; | ||
const int gigabyte = 1024 * megabyte; | ||
|
||
return size switch | ||
{ | ||
< kilobyte => $"{size:n0} bytes", | ||
< megabyte => $"{size / (double)kilobyte:n0} KB", | ||
< gigabyte => $"{size / (double)megabyte:n0} MB", | ||
_ => $"{size / (double)gigabyte:n2} GB" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.