|
@@ -10,8 +10,8 @@ import (
|
|
|
|
|
|
|
|
type countingReader struct {
|
|
type countingReader struct {
|
|
|
io.Reader
|
|
io.Reader
|
|
|
- tot int64 // bytes
|
|
|
|
|
- last int64 // unix nanos
|
|
|
|
|
|
|
+ tot int64 // bytes (atomic, must remain 64-bit aligned)
|
|
|
|
|
+ last int64 // unix nanos (atomic, must remain 64-bit aligned)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
var (
|
|
@@ -37,8 +37,8 @@ func (c *countingReader) Last() time.Time {
|
|
|
|
|
|
|
|
type countingWriter struct {
|
|
type countingWriter struct {
|
|
|
io.Writer
|
|
io.Writer
|
|
|
- tot int64 // bytes
|
|
|
|
|
- last int64 // unix nanos
|
|
|
|
|
|
|
+ tot int64 // bytes (atomic, must remain 64-bit aligned)
|
|
|
|
|
+ last int64 // unix nanos (atomic, must remain 64-bit aligned)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (c *countingWriter) Write(bs []byte) (int, error) {
|
|
func (c *countingWriter) Write(bs []byte) (int, error) {
|