Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-ds-measure
Commits
8f9904f3
Commit
8f9904f3
authored
Jun 26, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "add in support for batched writes"
parent
dc78fe9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
61 deletions
+0
-61
measure.go
measure.go
+0
-61
No files found.
measure.go
View file @
8f9904f3
...
...
@@ -148,67 +148,6 @@ func (m *measure) Query(q query.Query) (query.Results, error) {
return
res
,
err
}
type
measuredBatch
struct
{
puts
int
deletes
int
putts
datastore
.
Batch
delts
datastore
.
Batch
m
*
measure
}
func
(
m
*
measure
)
Batch
()
datastore
.
Batch
{
return
&
measuredBatch
{
putts
:
m
.
backend
.
Batch
(),
delts
:
m
.
backend
.
Batch
(),
m
:
m
,
}
}
func
(
mt
*
measuredBatch
)
Put
(
key
datastore
.
Key
,
val
interface
{})
error
{
mt
.
puts
++
return
mt
.
putts
.
Put
(
key
,
val
)
}
func
(
mt
*
measuredBatch
)
Delete
(
key
datastore
.
Key
)
error
{
mt
.
deletes
++
return
mt
.
delts
.
Delete
(
key
)
}
func
(
mt
*
measuredBatch
)
Commit
()
error
{
if
mt
.
deletes
>
0
{
before
:=
time
.
Now
()
err
:=
mt
.
delts
.
Commit
()
took
:=
int
(
time
.
Now
()
.
Sub
(
before
)
/
time
.
Microsecond
)
/
mt
.
deletes
mt
.
m
.
deleteNum
.
AddN
(
uint64
(
mt
.
deletes
))
for
i
:=
0
;
i
<
mt
.
deletes
;
i
++
{
mt
.
m
.
deleteLatency
.
RecordValue
(
int64
(
took
))
}
if
err
!=
nil
{
mt
.
m
.
deleteErr
.
Add
()
return
err
}
}
if
mt
.
puts
>
0
{
before
:=
time
.
Now
()
err
:=
mt
.
putts
.
Commit
()
took
:=
int
(
time
.
Now
()
.
Sub
(
before
)
/
time
.
Microsecond
)
/
mt
.
puts
mt
.
m
.
putNum
.
AddN
(
uint64
(
mt
.
puts
))
for
i
:=
0
;
i
<
mt
.
puts
;
i
++
{
mt
.
m
.
putLatency
.
RecordValue
(
int64
(
took
))
}
if
err
!=
nil
{
mt
.
m
.
putErr
.
Add
()
return
err
}
}
return
nil
}
func
(
m
*
measure
)
Close
()
error
{
m
.
putNum
.
Remove
()
m
.
putErr
.
Remove
()
...
...
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