mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Input file now pre-reads N requests, sort them by timestamp and emit on demand. You can control read depth using --input-file-read-depth which is 100 by default. It makes implementaiton faster, and it fix various issues when due to concurrenccy, or another issues requests gets addeed out of order.
34 lines
613 B
Go
34 lines
613 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// DummyOutput used for debugging, prints all incoming requests
|
|
type DummyOutput struct {
|
|
}
|
|
|
|
// NewDummyOutput constructor for DummyOutput
|
|
func NewDummyOutput() (di *DummyOutput) {
|
|
di = new(DummyOutput)
|
|
|
|
return
|
|
}
|
|
|
|
// PluginWrite writes message to this plugin
|
|
func (i *DummyOutput) PluginWrite(msg *Message) (int, error) {
|
|
var n, nn int
|
|
var err error
|
|
n, err = os.Stdout.Write(msg.Meta)
|
|
nn, err = os.Stdout.Write(msg.Data)
|
|
n += nn
|
|
nn, err = os.Stdout.Write(payloadSeparatorAsBytes)
|
|
n += nn
|
|
|
|
return n, err
|
|
}
|
|
|
|
func (i *DummyOutput) String() string {
|
|
return "Dummy Output"
|
|
}
|