func NewResponseCollector(op BatchOperation) ResponseCollector {
	return ResponseCollector{
		headerMap:   make(http.Header),
		Method:      op.Method,
		URL:         op.URL,
		OperationID: op.OperationID,
		StartedAt:   time.Now(),
		Status:      http.StatusOK,
	}
}
NewResponseCollector constructs a ResponseCollector with default values
package middleware
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"strings"
	"sync"
	"time"
	"github.com/optimizely/agent/config"
	"github.com/go-chi/render"
	"golang.org/x/sync/errgroup"
)
type BatchResponse struct {
	StartedAt     time.Time           `json:"startedAt"`
	EndedAt       time.Time           `json:"endedAt"`
	ErrorCount    int                 `json:"errorCount"`
	ResponseItems []ResponseCollector `json:"response"`
	lock sync.Mutex
}
func NewBatchResponse() *BatchResponse {
	return &BatchResponse{
		StartedAt:     time.Now(),
		ResponseItems: make([]ResponseCollector, 0),
	}
}
func (br *BatchResponse) append(col ResponseCollector) {
	br.lock.Lock()
	defer br.lock.Unlock()
	if col.Status != http.StatusOK {
		br.ErrorCount++
	}
	br.ResponseItems = append(br.ResponseItems, col)
	br.EndedAt = time.Now()
}
type ResponseCollector struct {
	Status      int         `json:"status"`
	RequestID   string      `json:"requestID"`
	OperationID string      `json:"operationID"`
	Method      string      `json:"method"`
	URL         string      `json:"url"`
	Body        interface{} `json:"body"`
	StartedAt time.Time `json:"startedAt"`
	EndedAt   time.Time `json:"endedAt"`
	headerMap http.Header
}