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
7b2a08f2
Commit
7b2a08f2
authored
May 01, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically set the number of threads in bulkstat.
parent
93d87c60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
example/bulkstat/Makefile
example/bulkstat/Makefile
+1
-0
example/bulkstat/bulkstat.go
example/bulkstat/bulkstat.go
+7
-2
No files found.
example/bulkstat/Makefile
View file @
7b2a08f2
...
@@ -3,6 +3,7 @@ include $(GOROOT)/src/Make.inc
...
@@ -3,6 +3,7 @@ include $(GOROOT)/src/Make.inc
TARG
=
bulkstat
TARG
=
bulkstat
GOFILES
=
bulkstat.go
GOFILES
=
bulkstat.go
DEPS
=
../../fuse
include
$(GOROOT)/src/Make.cmd
include
$(GOROOT)/src/Make.cmd
example/bulkstat/bulkstat.go
View file @
7b2a08f2
...
@@ -4,20 +4,25 @@ package main
...
@@ -4,20 +4,25 @@ package main
// in parallel. This is useful for benchmarking purposes.
// in parallel. This is useful for benchmarking purposes.
import
(
import
(
"github.com/hanwen/go-fuse/fuse"
"os"
"os"
"flag"
"flag"
"time"
"time"
"fmt"
"fmt"
"encoding/line"
"encoding/line"
"runtime"
)
)
func
main
()
{
func
main
()
{
threads
:=
flag
.
Int
(
"threads"
,
12
,
"number of parallel threads in a run
."
)
threads
:=
flag
.
Int
(
"threads"
,
0
,
"number of parallel threads in a run. If 0, use CPU count
."
)
sleepTime
:=
flag
.
Float64
(
"sleep"
,
4.0
,
"amount of sleep between runs."
)
sleepTime
:=
flag
.
Float64
(
"sleep"
,
4.0
,
"amount of sleep between runs."
)
runs
:=
flag
.
Int
(
"runs"
,
10
,
"number of runs."
)
runs
:=
flag
.
Int
(
"runs"
,
10
,
"number of runs."
)
flag
.
Parse
()
flag
.
Parse
()
if
*
threads
==
0
{
*
threads
=
fuse
.
CountCpus
()
runtime
.
GOMAXPROCS
(
*
threads
)
}
filename
:=
flag
.
Args
()[
0
]
filename
:=
flag
.
Args
()[
0
]
f
,
err
:=
os
.
Open
(
filename
)
f
,
err
:=
os
.
Open
(
filename
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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