Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
990f3c11
Commit
990f3c11
authored
Apr 22, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make recording latency statistics optional.
parent
bfe98501
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
fuse/fuse.go
fuse/fuse.go
+15
-12
No files found.
fuse/fuse.go
View file @
990f3c11
...
@@ -71,6 +71,7 @@ type MountState struct {
...
@@ -71,6 +71,7 @@ type MountState struct {
// For efficient reads and writes.
// For efficient reads and writes.
buffers
*
BufferPool
buffers
*
BufferPool
RecordStatistics
bool
statisticsMutex
sync
.
Mutex
statisticsMutex
sync
.
Mutex
operationCounts
map
[
string
]
int64
operationCounts
map
[
string
]
int64
...
@@ -186,21 +187,23 @@ func (me *MountState) discardRequest(req *request) {
...
@@ -186,21 +187,23 @@ func (me *MountState) discardRequest(req *request) {
endNs
:=
time
.
Nanoseconds
()
endNs
:=
time
.
Nanoseconds
()
dt
:=
endNs
-
req
.
startNs
dt
:=
endNs
-
req
.
startNs
me
.
statisticsMutex
.
Lock
()
if
me
.
RecordStatistics
{
defer
me
.
statisticsMutex
.
Unlock
()
me
.
statisticsMutex
.
Lock
()
defer
me
.
statisticsMutex
.
Unlock
()
opname
:=
operationName
(
req
.
inHeader
.
Opcode
)
opname
:=
operationName
(
req
.
inHeader
.
Opcode
)
key
:=
opname
key
:=
opname
me
.
operationCounts
[
key
]
+=
1
me
.
operationCounts
[
key
]
+=
1
me
.
operationLatencies
[
key
]
+=
dt
me
.
operationLatencies
[
key
]
+=
dt
key
+=
"-dispatch"
key
+=
"-dispatch"
me
.
operationLatencies
[
key
]
+=
(
req
.
dispatchNs
-
req
.
startNs
)
me
.
operationLatencies
[
key
]
+=
(
req
.
dispatchNs
-
req
.
startNs
)
me
.
operationCounts
[
key
]
+=
1
me
.
operationCounts
[
key
]
+=
1
key
=
opname
+
"-write"
key
=
opname
+
"-write"
me
.
operationLatencies
[
key
]
+=
(
endNs
-
req
.
preWriteNs
)
me
.
operationLatencies
[
key
]
+=
(
endNs
-
req
.
preWriteNs
)
me
.
operationCounts
[
key
]
+=
1
me
.
operationCounts
[
key
]
+=
1
}
me
.
buffers
.
FreeBuffer
(
req
.
inputBuf
)
me
.
buffers
.
FreeBuffer
(
req
.
inputBuf
)
me
.
buffers
.
FreeBuffer
(
req
.
flatData
)
me
.
buffers
.
FreeBuffer
(
req
.
flatData
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment