Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
ba8a883d
Commit
ba8a883d
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Sum up size of all expired directories in grace location summary
Relates to
#20
parent
fc475b81
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/StorageStatus.cs
+4
-0
4 additions, 0 deletions
ATxCommon/StorageStatus.cs
with
4 additions
and
0 deletions
ATxCommon/StorageStatus.cs
+
4
−
0
View file @
ba8a883d
...
@@ -82,6 +82,7 @@ namespace ATxCommon
...
@@ -82,6 +82,7 @@ namespace ATxCommon
/// and all expired directories, grouped by the topmost level (i.e. user dirs).</returns>
/// and all expired directories, grouped by the topmost level (i.e. user dirs).</returns>
public
string
GraceLocationSummary
()
{
public
string
GraceLocationSummary
()
{
UpdateGraceLocation
();
UpdateGraceLocation
();
long
totalSizeExpired
=
0
;
var
summary
=
"------ Grace location status, "
+
var
summary
=
"------ Grace location status, "
+
$"threshold:
{
_gracePeriod
}
days (
{
_gracePeriodHuman
}
) ------\n\n"
+
$"threshold:
{
_gracePeriod
}
days (
{
_gracePeriodHuman
}
) ------\n\n"
+
$" - location: [
{
_graceLocation
}
]\n"
;
$" - location: [
{
_graceLocation
}
]\n"
;
...
@@ -92,12 +93,15 @@ namespace ATxCommon
...
@@ -92,12 +93,15 @@ namespace ATxCommon
foreach
(
var
dir
in
_expiredDirs
.
Keys
)
{
foreach
(
var
dir
in
_expiredDirs
.
Keys
)
{
summary
+=
"\n - directory '"
+
dir
+
"'\n"
;
summary
+=
"\n - directory '"
+
dir
+
"'\n"
;
foreach
(
var
subdir
in
_expiredDirs
[
dir
])
{
foreach
(
var
subdir
in
_expiredDirs
[
dir
])
{
totalSizeExpired
+=
subdir
.
Size
;
summary
+=
$" -
{
subdir
.
Dir
.
Name
}
"
+
summary
+=
$" -
{
subdir
.
Dir
.
Name
}
"
+
$"[age:
{
subdir
.
HumanAgeFromName
}
, "
+
$"[age:
{
subdir
.
HumanAgeFromName
}
, "
+
$"size:
{
subdir
.
HumanSize
}
]\n"
;
$"size:
{
subdir
.
HumanSize
}
]\n"
;
}
}
}
}
summary
+=
$"\n - sum of expired folders:
{
Conv
.
BytesToString
(
totalSizeExpired
)}
\n"
;
return
summary
;
return
summary
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment