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
dc78fe9d
Commit
dc78fe9d
authored
Jun 26, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename Transaction to Batch
parent
f26974c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
measure.go
measure.go
+10
-10
No files found.
measure.go
View file @
dc78fe9d
...
...
@@ -148,36 +148,36 @@ func (m *measure) Query(q query.Query) (query.Results, error) {
return
res
,
err
}
type
measured
Transaction
struct
{
type
measured
Batch
struct
{
puts
int
deletes
int
putts
datastore
.
Transaction
delts
datastore
.
Transaction
putts
datastore
.
Batch
delts
datastore
.
Batch
m
*
measure
}
func
(
m
*
measure
)
Start
Batch
Op
()
datastore
.
Transaction
{
return
&
measured
Transaction
{
putts
:
m
.
backend
.
Start
Batch
Op
(),
delts
:
m
.
backend
.
Start
Batch
Op
(),
func
(
m
*
measure
)
Batch
()
datastore
.
Batch
{
return
&
measured
Batch
{
putts
:
m
.
backend
.
Batch
(),
delts
:
m
.
backend
.
Batch
(),
m
:
m
,
}
}
func
(
mt
*
measured
Transaction
)
Put
(
key
datastore
.
Key
,
val
interface
{})
error
{
func
(
mt
*
measured
Batch
)
Put
(
key
datastore
.
Key
,
val
interface
{})
error
{
mt
.
puts
++
return
mt
.
putts
.
Put
(
key
,
val
)
}
func
(
mt
*
measured
Transaction
)
Delete
(
key
datastore
.
Key
)
error
{
func
(
mt
*
measured
Batch
)
Delete
(
key
datastore
.
Key
)
error
{
mt
.
deletes
++
return
mt
.
delts
.
Delete
(
key
)
}
func
(
mt
*
measured
Transaction
)
Commit
()
error
{
func
(
mt
*
measured
Batch
)
Commit
()
error
{
if
mt
.
deletes
>
0
{
before
:=
time
.
Now
()
err
:=
mt
.
delts
.
Commit
()
...
...
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