Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parallel downloads job #2005

Merged
merged 9 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# GCSFuse Metrics
GCSFuse supports exporting custom metrics to Google cloud monitoring.
Metrics are collected using OpenCensus and exported via Stackdriver exporter.
Expand All @@ -15,7 +16,7 @@ can group by op_type.

## GCS metrics
* **gcs/download_bytes_count:** Cumulative number of bytes downloaded from GCS along
with read type. Read type specifies sequential or random read.
with read type. Read type specifies sequential or random or parallel read.
* **gcs/read_bytes_count:** Cumulative number of bytes read from GCS objects. This
is different from download_bytes_count. For eg: we might download x number of
bytes from GCS but read only <x bytes.
Expand Down
31 changes: 17 additions & 14 deletions internal/cache/file/downloader/downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ import (
"testing"
"time"

"github.com/googlecloudplatform/gcsfuse/v2/internal/config"
"github.com/googlecloudplatform/gcsfuse/v2/internal/locker"

"github.com/googlecloudplatform/gcsfuse/v2/internal/cache/data"
"github.com/googlecloudplatform/gcsfuse/v2/internal/cache/lru"
"github.com/googlecloudplatform/gcsfuse/v2/internal/cache/util"
"github.com/googlecloudplatform/gcsfuse/v2/internal/config"
"github.com/googlecloudplatform/gcsfuse/v2/internal/locker"
"github.com/googlecloudplatform/gcsfuse/v2/internal/storage"
"github.com/googlecloudplatform/gcsfuse/v2/internal/storage/gcs"
testutil "github.com/googlecloudplatform/gcsfuse/v2/internal/util"
Expand All @@ -40,18 +39,19 @@ var cacheDir = path.Join(os.Getenv("HOME"), "cache/dir")
func TestDownloader(t *testing.T) { RunTests(t) }

type downloaderTest struct {
job *Job
bucket gcs.Bucket
object gcs.MinObject
cache *lru.Cache
fakeStorage storage.FakeStorage
fileSpec data.FileSpec
jm *JobManager
defaultFileCacheConfig *config.FileCacheConfig
job *Job
bucket gcs.Bucket
object gcs.MinObject
cache *lru.Cache
fakeStorage storage.FakeStorage
fileSpec data.FileSpec
jm *JobManager
}

func init() { RegisterTestSuite(&downloaderTest{}) }

func (dt *downloaderTest) SetUp(*TestInfo) {
func (dt *downloaderTest) setupHelper() {
locker.EnableInvariantsCheck()
operations.RemoveDir(cacheDir)

Expand All @@ -61,9 +61,12 @@ func (dt *downloaderTest) SetUp(*TestInfo) {
dt.bucket = storageHandle.BucketHandle(storage.TestBucketName, "")

dt.initJobTest(DefaultObjectName, []byte("taco"), DefaultSequentialReadSizeMb, CacheMaxSize, func() {})
dt.jm = NewJobManager(dt.cache, util.DefaultFilePerm, util.DefaultDirPerm, cacheDir, DefaultSequentialReadSizeMb, &config.FileCacheConfig{
EnableCrcCheck: true,
})
dt.jm = NewJobManager(dt.cache, util.DefaultFilePerm, util.DefaultDirPerm, cacheDir, DefaultSequentialReadSizeMb, dt.defaultFileCacheConfig)
}

func (dt *downloaderTest) SetUp(*TestInfo) {
dt.defaultFileCacheConfig = &config.FileCacheConfig{EnableCrcCheck: true}
dt.setupHelper()
}

func (dt *downloaderTest) TearDown() {
Expand Down
Loading
Loading