File tree Expand file tree Collapse file tree 7 files changed +100
-72
lines changed
client/vfs_legacy/filesystem
metrics/client/vfs_legacy Expand file tree Collapse file tree 7 files changed +100
-72
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ namespace dingofs {
33
33
namespace client {
34
34
namespace filesystem {
35
35
36
+ using metrics::client::vfs_legacy::DirCacheMetric;
36
37
using utils::ReadLockGuard;
37
38
using utils::RWLock;
38
39
using utils::TimeSpec;
Original file line number Diff line number Diff line change 28
28
29
29
#include " absl/container/btree_map.h"
30
30
#include " client/vfs_legacy/filesystem/meta.h"
31
- #include " client/vfs_legacy/filesystem/metric .h"
31
+ #include " metrics/ client/vfs_legacy/dir_cache .h"
32
32
#include " options/client/vfs_legacy/vfs_legacy_option.h"
33
33
#include " utils/concurrent/concurrent.h"
34
34
#include " utils/lru_cache.h"
@@ -98,7 +98,7 @@ class DirCache {
98
98
DirCacheOption option_;
99
99
std::shared_ptr<LRUType> lru_;
100
100
std::shared_ptr<MessageQueueType> mq_;
101
- std::shared_ptr<DirCacheMetric> metric_;
101
+ std::shared_ptr<metrics::client::vfs_legacy:: DirCacheMetric> metric_;
102
102
};
103
103
104
104
} // namespace filesystem
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ namespace dingofs {
32
32
namespace client {
33
33
namespace filesystem {
34
34
35
+ using metrics::client::vfs_legacy::OpenfilesMetric;
35
36
using utils::ReadLockGuard;
36
37
using utils::WriteLockGuard;
37
38
Original file line number Diff line number Diff line change 28
28
29
29
#include " client/vfs_legacy/filesystem/defer_sync.h"
30
30
#include " client/vfs_legacy/filesystem/meta.h"
31
- #include " client/vfs_legacy/filesystem/metric.h"
32
31
#include " client/vfs_legacy/inode_wrapper.h"
32
+ #include " metrics/client/vfs_legacy/open_files.h"
33
33
#include " options/client/vfs_legacy/vfs_legacy_option.h"
34
34
35
35
namespace dingofs {
@@ -66,7 +66,7 @@ class OpenFiles {
66
66
OpenFilesOption option_;
67
67
std::shared_ptr<DeferSync> deferSync_;
68
68
std::unordered_map<Ino, std::unique_ptr<OpenFile>> files_;
69
- std::shared_ptr<OpenfilesMetric> metric_;
69
+ std::shared_ptr<metrics::client::vfs_legacy:: OpenfilesMetric> metric_;
70
70
};
71
71
72
72
} // namespace filesystem
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 dingodb.com, Inc. All Rights Reserved
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #ifndef DINGOFS_SRC_METRICS_CLIENT_VFS_LEGACY_DIR_CACHE_H_
18
+ #define DINGOFS_SRC_METRICS_CLIENT_VFS_LEGACY_DIR_CACHE_H_
19
+
20
+ #include < bvar/bvar.h>
21
+
22
+ namespace dingofs {
23
+ namespace metrics {
24
+ namespace client {
25
+ namespace vfs_legacy {
26
+
27
+ class DirCacheMetric {
28
+ public:
29
+ DirCacheMetric () = default ;
30
+
31
+ void AddEntries (int64_t n) { metric_.nentries << n; }
32
+
33
+ private:
34
+ struct Metric {
35
+ Metric () : nentries(" filesystem_dircache" , " nentries" ) {}
36
+ bvar::Adder<int64_t > nentries;
37
+ };
38
+
39
+ Metric metric_;
40
+ };
41
+
42
+ } // namespace vfs_legacy
43
+ } // namespace client
44
+ } // namespace metrics
45
+ } // namespace dingofs
46
+
47
+ #endif // DINGOFS_SRC_METRICS_CLIENT_VFS_LEGACY_DIR_CACHE_H_
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 dingodb.com, Inc. All Rights Reserved
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #ifndef DINGOFS_SRC_METRICS_CLIENT_VFS_LEGACY_OPEN_FILES_H_
18
+ #define DINGOFS_SRC_METRICS_CLIENT_VFS_LEGACY_OPEN_FILES_H_
19
+
20
+ #include < bvar/bvar.h>
21
+
22
+ namespace dingofs {
23
+ namespace metrics {
24
+ namespace client {
25
+ namespace vfs_legacy {
26
+
27
+ class OpenfilesMetric {
28
+ public:
29
+ OpenfilesMetric () = default ;
30
+
31
+ void AddOpenfiles (int64_t n) { metric_.nfiles << n; }
32
+
33
+ private:
34
+ struct Metric {
35
+ Metric () : nfiles(" filesystem_openfiles" , " nfiles" ) {}
36
+ bvar::Adder<int64_t > nfiles;
37
+ };
38
+
39
+ Metric metric_;
40
+ };
41
+
42
+ } // namespace vfs_legacy
43
+ } // namespace client
44
+ } // namespace metrics
45
+ } // namespace dingofs
46
+
47
+ #endif // DINGOFS_SRC_METRICS_CLIENT_VFS_LEGACY_OPEN_FILES_H_
You can’t perform that action at this time.
0 commit comments