| 16 | ) |
| 17 | |
| 18 | type DiskBuffer struct { |
| 19 | BufferStats |
| 20 | sync.Mutex |
| 21 | |
| 22 | file *wal.Log |
| 23 | path string |
| 24 | |
| 25 | batchFirst uint64 // Index of the first metric in the batch |
| 26 | batchSize uint64 // Number of metrics currently in the batch |
| 27 | |
| 28 | // Ending point of metrics read from disk on telegraf launch. |
| 29 | // Used to know whether to discard tracking metrics. |
| 30 | originalEnd uint64 |
| 31 | |
| 32 | // The mask contains offsets of metric already removed during a previous |
| 33 | // transaction. Metrics at those offsets should not be contained in new |
| 34 | // batches. |
| 35 | mask []int |
| 36 | } |
| 37 | |
| 38 | func NewDiskBuffer(id, path string, stats BufferStats, diskSync bool) (*DiskBuffer, error) { |
| 39 | filePath := filepath.Join(path, id) |
nothing calls this directly
no outgoing calls
no test coverage detected