-
Notifications
You must be signed in to change notification settings - Fork 2
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 moby#49210 from thaJeztah/internalize_fd_count
pkg/fileutils: move GetTotalUsedFds internal in daemon
- Loading branch information
Showing
8 changed files
with
28 additions
and
56 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
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
14 changes: 14 additions & 0 deletions
14
daemon/internal/filedescriptors/filiedescriptors_linux_test.go
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,14 @@ | ||
package filedescriptors | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
) | ||
|
||
func BenchmarkGetTotalUsedFds(b *testing.B) { | ||
ctx := context.Background() | ||
b.ReportAllocs() | ||
for i := 0; i < b.N; i++ { | ||
_ = GetTotalUsedFds(ctx) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
daemon/internal/filedescriptors/filiedescriptors_unsupported.go
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,11 @@ | ||
//go:build !linux | ||
|
||
package filedescriptors | ||
|
||
import "context" | ||
|
||
// GetTotalUsedFds Returns the number of used File Descriptors. Not supported | ||
// on Windows. | ||
func GetTotalUsedFds(context.Context) int { | ||
return -1 | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.