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
Kirill Smelkov
go-fuse
Commits
53e99700
Commit
53e99700
authored
Nov 30, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide LatencyMap member in MountState
parent
ae9dcc28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
fuse/mountstate.go
fuse/mountstate.go
+9
-9
No files found.
fuse/mountstate.go
View file @
53e99700
...
...
@@ -29,7 +29,7 @@ type MountState struct {
// For efficient reads and writes.
buffers
*
BufferPoolImpl
*
LatencyMap
latencies
*
LatencyMap
opts
*
MountOptions
kernelSettings
InitIn
...
...
@@ -88,9 +88,9 @@ func (me *MountState) Mount(mountPoint string, opts *MountOptions) error {
func
(
me
*
MountState
)
SetRecordStatistics
(
record
bool
)
{
if
record
{
me
.
LatencyMap
=
NewLatencyMap
()
me
.
latencies
=
NewLatencyMap
()
}
else
{
me
.
LatencyMap
=
nil
me
.
latencies
=
nil
}
}
...
...
@@ -125,11 +125,11 @@ func NewMountState(fs RawFileSystem) *MountState {
}
func
(
me
*
MountState
)
Latencies
()
map
[
string
]
float64
{
return
me
.
LatencyMap
.
Latencies
(
1e-3
)
return
me
.
latencies
.
Latencies
(
1e-3
)
}
func
(
me
*
MountState
)
OperationCounts
()
map
[
string
]
int
{
return
me
.
LatencyMap
.
Counts
()
return
me
.
latencies
.
Counts
()
}
func
(
me
*
MountState
)
BufferPoolStats
()
string
{
...
...
@@ -147,7 +147,7 @@ func (me *MountState) readRequest(req *request) Status {
n
,
err
:=
me
.
mountFile
.
Read
(
req
.
inputBuf
)
// If we start timing before the read, we may take into
// account waiting for input into the timing.
if
me
.
LatencyMap
!=
nil
{
if
me
.
latencies
!=
nil
{
req
.
startNs
=
time
.
Nanoseconds
()
}
req
.
inputBuf
=
req
.
inputBuf
[
0
:
n
]
...
...
@@ -155,12 +155,12 @@ func (me *MountState) readRequest(req *request) Status {
}
func
(
me
*
MountState
)
recordStats
(
req
*
request
)
{
if
me
.
LatencyMap
!=
nil
{
if
me
.
latencies
!=
nil
{
endNs
:=
time
.
Nanoseconds
()
dt
:=
endNs
-
req
.
startNs
opname
:=
operationName
(
req
.
inHeader
.
opcode
)
me
.
LatencyMap
.
AddMany
(
me
.
latencies
.
AddMany
(
[]
LatencyArg
{
{
opname
,
""
,
dt
},
{
opname
+
"-write"
,
""
,
endNs
-
req
.
preWriteNs
}})
...
...
@@ -254,7 +254,7 @@ func (me *MountState) write(req *request) Status {
log
.
Println
(
req
.
OutputDebug
())
}
if
me
.
LatencyMap
!=
nil
{
if
me
.
latencies
!=
nil
{
req
.
preWriteNs
=
time
.
Nanoseconds
()
}
...
...
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