// This file was generated by counterfeiter
package fakes

import (
	"sync"

	"github.com/cloudfoundry/dropsonde/metric_sender"
	"github.com/cloudfoundry/dropsonde/metrics"
	"github.com/cloudfoundry/sonde-go/events"
)

type MetricSender struct {
	SendStub        func(event events.Event) error
	sendMutex       sync.RWMutex
	sendArgsForCall []struct {
		event events.Event
	}
	sendReturns struct {
		result1 error
	}
	ValueStub        func(name string, value float64, unit string) metric_sender.ValueChainer
	valueMutex       sync.RWMutex
	valueArgsForCall []struct {
		name  string
		value float64
		unit  string
	}
	valueReturns struct {
		result1 metric_sender.ValueChainer
	}
	ContainerMetricStub        func(appID string, instance int32, cpu float64, mem, disk uint64) metric_sender.ContainerMetricChainer
	containerMetricMutex       sync.RWMutex
	containerMetricArgsForCall []struct {
		appID    string
		instance int32
		cpu      float64
		mem      uint64
		disk     uint64
	}
	containerMetricReturns struct {
		result1 metric_sender.ContainerMetricChainer
	}
	CounterStub        func(name string) metric_sender.CounterChainer
	counterMutex       sync.RWMutex
	counterArgsForCall []struct {
		name string
	}
	counterReturns struct {
		result1 metric_sender.CounterChainer
	}
	SendValueStub        func(name string, value float64, unit string) error
	sendValueMutex       sync.RWMutex
	sendValueArgsForCall []struct {
		name  string
		value float64
		unit  string
	}
	sendValueReturns struct {
		result1 error
	}
	IncrementCounterStub        func(name string) error
	incrementCounterMutex       sync.RWMutex
	incrementCounterArgsForCall []struct {
		name string
	}
	incrementCounterReturns struct {
		result1 error
	}
	AddToCounterStub        func(name string, delta uint64) error
	addToCounterMutex       sync.RWMutex
	addToCounterArgsForCall []struct {
		name  string
		delta uint64
	}
	addToCounterReturns struct {
		result1 error
	}
	SendContainerMetricStub        func(applicationId string, instanceIndex int32, cpuPercentage float64, memoryBytes uint64, diskBytes uint64) error
	sendContainerMetricMutex       sync.RWMutex
	sendContainerMetricArgsForCall []struct {
		applicationId string
		instanceIndex int32
		cpuPercentage float64
		memoryBytes   uint64
		diskBytes     uint64
	}
	sendContainerMetricReturns struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *MetricSender) Send(event events.Event) error {
	fake.sendMutex.Lock()
	fake.sendArgsForCall = append(fake.sendArgsForCall, struct {
		event events.Event
	}{event})
	fake.recordInvocation("Send", []interface{}{event})
	fake.sendMutex.Unlock()
	if fake.SendStub != nil {
		return fake.SendStub(event)
	}
	return fake.sendReturns.result1
}

func (fake *MetricSender) SendCallCount() int {
	fake.sendMutex.RLock()
	defer fake.sendMutex.RUnlock()
	return len(fake.sendArgsForCall)
}

func (fake *MetricSender) SendArgsForCall(i int) events.Event {
	fake.sendMutex.RLock()
	defer fake.sendMutex.RUnlock()
	return fake.sendArgsForCall[i].event
}

func (fake *MetricSender) SendReturns(result1 error) {
	fake.SendStub = nil
	fake.sendReturns = struct {
		result1 error
	}{result1}
}

func (fake *MetricSender) Value(name string, value float64, unit string) metric_sender.ValueChainer {
	fake.valueMutex.Lock()
	fake.valueArgsForCall = append(fake.valueArgsForCall, struct {
		name  string
		value float64
		unit  string
	}{name, value, unit})
	fake.recordInvocation("Value", []interface{}{name, value, unit})
	fake.valueMutex.Unlock()
	if fake.ValueStub != nil {
		return fake.ValueStub(name, value, unit)
	}
	return fake.valueReturns.result1
}

func (fake *MetricSender) ValueCallCount() int {
	fake.valueMutex.RLock()
	defer fake.valueMutex.RUnlock()
	return len(fake.valueArgsForCall)
}

func (fake *MetricSender) ValueArgsForCall(i int) (string, float64, string) {
	fake.valueMutex.RLock()
	defer fake.valueMutex.RUnlock()
	return fake.valueArgsForCall[i].name, fake.valueArgsForCall[i].value, fake.valueArgsForCall[i].unit
}

func (fake *MetricSender) ValueReturns(result1 metric_sender.ValueChainer) {
	fake.ValueStub = nil
	fake.valueReturns = struct {
		result1 metric_sender.ValueChainer
	}{result1}
}

func (fake *MetricSender) ContainerMetric(appID string, instance int32, cpu float64, mem uint64, disk uint64) metric_sender.ContainerMetricChainer {
	fake.containerMetricMutex.Lock()
	fake.containerMetricArgsForCall = append(fake.containerMetricArgsForCall, struct {
		appID    string
		instance int32
		cpu      float64
		mem      uint64
		disk     uint64
	}{appID, instance, cpu, mem, disk})
	fake.recordInvocation("ContainerMetric", []interface{}{appID, instance, cpu, mem, disk})
	fake.containerMetricMutex.Unlock()
	if fake.ContainerMetricStub != nil {
		return fake.ContainerMetricStub(appID, instance, cpu, mem, disk)
	}
	return fake.containerMetricReturns.result1
}

func (fake *MetricSender) ContainerMetricCallCount() int {
	fake.containerMetricMutex.RLock()
	defer fake.containerMetricMutex.RUnlock()
	return len(fake.containerMetricArgsForCall)
}

func (fake *MetricSender) ContainerMetricArgsForCall(i int) (string, int32, float64, uint64, uint64) {
	fake.containerMetricMutex.RLock()
	defer fake.containerMetricMutex.RUnlock()
	return fake.containerMetricArgsForCall[i].appID, fake.containerMetricArgsForCall[i].instance, fake.containerMetricArgsForCall[i].cpu, fake.containerMetricArgsForCall[i].mem, fake.containerMetricArgsForCall[i].disk
}

func (fake *MetricSender) ContainerMetricReturns(result1 metric_sender.ContainerMetricChainer) {
	fake.ContainerMetricStub = nil
	fake.containerMetricReturns = struct {
		result1 metric_sender.ContainerMetricChainer
	}{result1}
}

func (fake *MetricSender) Counter(name string) metric_sender.CounterChainer {
	fake.counterMutex.Lock()
	fake.counterArgsForCall = append(fake.counterArgsForCall, struct {
		name string
	}{name})
	fake.recordInvocation("Counter", []interface{}{name})
	fake.counterMutex.Unlock()
	if fake.CounterStub != nil {
		return fake.CounterStub(name)
	}
	return fake.counterReturns.result1
}

func (fake *MetricSender) CounterCallCount() int {
	fake.counterMutex.RLock()
	defer fake.counterMutex.RUnlock()
	return len(fake.counterArgsForCall)
}

func (fake *MetricSender) CounterArgsForCall(i int) string {
	fake.counterMutex.RLock()
	defer fake.counterMutex.RUnlock()
	return fake.counterArgsForCall[i].name
}

func (fake *MetricSender) CounterReturns(result1 metric_sender.CounterChainer) {
	fake.CounterStub = nil
	fake.counterReturns = struct {
		result1 metric_sender.CounterChainer
	}{result1}
}

func (fake *MetricSender) SendValue(name string, value float64, unit string) error {
	fake.sendValueMutex.Lock()
	fake.sendValueArgsForCall = append(fake.sendValueArgsForCall, struct {
		name  string
		value float64
		unit  string
	}{name, value, unit})
	fake.recordInvocation("SendValue", []interface{}{name, value, unit})
	fake.sendValueMutex.Unlock()
	if fake.SendValueStub != nil {
		return fake.SendValueStub(name, value, unit)
	}
	return fake.sendValueReturns.result1
}

func (fake *MetricSender) SendValueCallCount() int {
	fake.sendValueMutex.RLock()
	defer fake.sendValueMutex.RUnlock()
	return len(fake.sendValueArgsForCall)
}

func (fake *MetricSender) SendValueArgsForCall(i int) (string, float64, string) {
	fake.sendValueMutex.RLock()
	defer fake.sendValueMutex.RUnlock()
	return fake.sendValueArgsForCall[i].name, fake.sendValueArgsForCall[i].value, fake.sendValueArgsForCall[i].unit
}

func (fake *MetricSender) SendValueReturns(result1 error) {
	fake.SendValueStub = nil
	fake.sendValueReturns = struct {
		result1 error
	}{result1}
}

func (fake *MetricSender) IncrementCounter(name string) error {
	fake.incrementCounterMutex.Lock()
	fake.incrementCounterArgsForCall = append(fake.incrementCounterArgsForCall, struct {
		name string
	}{name})
	fake.recordInvocation("IncrementCounter", []interface{}{name})
	fake.incrementCounterMutex.Unlock()
	if fake.IncrementCounterStub != nil {
		return fake.IncrementCounterStub(name)
	}
	return fake.incrementCounterReturns.result1
}

func (fake *MetricSender) IncrementCounterCallCount() int {
	fake.incrementCounterMutex.RLock()
	defer fake.incrementCounterMutex.RUnlock()
	return len(fake.incrementCounterArgsForCall)
}

func (fake *MetricSender) IncrementCounterArgsForCall(i int) string {
	fake.incrementCounterMutex.RLock()
	defer fake.incrementCounterMutex.RUnlock()
	return fake.incrementCounterArgsForCall[i].name
}

func (fake *MetricSender) IncrementCounterReturns(result1 error) {
	fake.IncrementCounterStub = nil
	fake.incrementCounterReturns = struct {
		result1 error
	}{result1}
}

func (fake *MetricSender) AddToCounter(name string, delta uint64) error {
	fake.addToCounterMutex.Lock()
	fake.addToCounterArgsForCall = append(fake.addToCounterArgsForCall, struct {
		name  string
		delta uint64
	}{name, delta})
	fake.recordInvocation("AddToCounter", []interface{}{name, delta})
	fake.addToCounterMutex.Unlock()
	if fake.AddToCounterStub != nil {
		return fake.AddToCounterStub(name, delta)
	}
	return fake.addToCounterReturns.result1
}

func (fake *MetricSender) AddToCounterCallCount() int {
	fake.addToCounterMutex.RLock()
	defer fake.addToCounterMutex.RUnlock()
	return len(fake.addToCounterArgsForCall)
}

func (fake *MetricSender) AddToCounterArgsForCall(i int) (string, uint64) {
	fake.addToCounterMutex.RLock()
	defer fake.addToCounterMutex.RUnlock()
	return fake.addToCounterArgsForCall[i].name, fake.addToCounterArgsForCall[i].delta
}

func (fake *MetricSender) AddToCounterReturns(result1 error) {
	fake.AddToCounterStub = nil
	fake.addToCounterReturns = struct {
		result1 error
	}{result1}
}

func (fake *MetricSender) SendContainerMetric(applicationId string, instanceIndex int32, cpuPercentage float64, memoryBytes uint64, diskBytes uint64) error {
	fake.sendContainerMetricMutex.Lock()
	fake.sendContainerMetricArgsForCall = append(fake.sendContainerMetricArgsForCall, struct {
		applicationId string
		instanceIndex int32
		cpuPercentage float64
		memoryBytes   uint64
		diskBytes     uint64
	}{applicationId, instanceIndex, cpuPercentage, memoryBytes, diskBytes})
	fake.recordInvocation("SendContainerMetric", []interface{}{applicationId, instanceIndex, cpuPercentage, memoryBytes, diskBytes})
	fake.sendContainerMetricMutex.Unlock()
	if fake.SendContainerMetricStub != nil {
		return fake.SendContainerMetricStub(applicationId, instanceIndex, cpuPercentage, memoryBytes, diskBytes)
	}
	return fake.sendContainerMetricReturns.result1
}

func (fake *MetricSender) SendContainerMetricCallCount() int {
	fake.sendContainerMetricMutex.RLock()
	defer fake.sendContainerMetricMutex.RUnlock()
	return len(fake.sendContainerMetricArgsForCall)
}

func (fake *MetricSender) SendContainerMetricArgsForCall(i int) (string, int32, float64, uint64, uint64) {
	fake.sendContainerMetricMutex.RLock()
	defer fake.sendContainerMetricMutex.RUnlock()
	return fake.sendContainerMetricArgsForCall[i].applicationId, fake.sendContainerMetricArgsForCall[i].instanceIndex, fake.sendContainerMetricArgsForCall[i].cpuPercentage, fake.sendContainerMetricArgsForCall[i].memoryBytes, fake.sendContainerMetricArgsForCall[i].diskBytes
}

func (fake *MetricSender) SendContainerMetricReturns(result1 error) {
	fake.SendContainerMetricStub = nil
	fake.sendContainerMetricReturns = struct {
		result1 error
	}{result1}
}

func (fake *MetricSender) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.sendMutex.RLock()
	defer fake.sendMutex.RUnlock()
	fake.valueMutex.RLock()
	defer fake.valueMutex.RUnlock()
	fake.containerMetricMutex.RLock()
	defer fake.containerMetricMutex.RUnlock()
	fake.counterMutex.RLock()
	defer fake.counterMutex.RUnlock()
	fake.sendValueMutex.RLock()
	defer fake.sendValueMutex.RUnlock()
	fake.incrementCounterMutex.RLock()
	defer fake.incrementCounterMutex.RUnlock()
	fake.addToCounterMutex.RLock()
	defer fake.addToCounterMutex.RUnlock()
	fake.sendContainerMetricMutex.RLock()
	defer fake.sendContainerMetricMutex.RUnlock()
	return fake.invocations
}

func (fake *MetricSender) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ metrics.MetricSender = new(MetricSender)
