// Code generated by counterfeiter. DO NOT EDIT.
package fakes

import (
	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/metricsforwarder/forwarder"
	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/models"
	"sync"
)

type FakeMetricForwarder struct {
	EmitMetricStub        func(*models.CustomMetric)
	emitMetricMutex       sync.RWMutex
	emitMetricArgsForCall []struct {
		arg1 *models.CustomMetric
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeMetricForwarder) EmitMetric(arg1 *models.CustomMetric) {
	fake.emitMetricMutex.Lock()
	fake.emitMetricArgsForCall = append(fake.emitMetricArgsForCall, struct {
		arg1 *models.CustomMetric
	}{arg1})
	fake.recordInvocation("EmitMetric", []interface{}{arg1})
	fake.emitMetricMutex.Unlock()
	if fake.EmitMetricStub != nil {
		fake.EmitMetricStub(arg1)
	}
}

func (fake *FakeMetricForwarder) EmitMetricCallCount() int {
	fake.emitMetricMutex.RLock()
	defer fake.emitMetricMutex.RUnlock()
	return len(fake.emitMetricArgsForCall)
}

func (fake *FakeMetricForwarder) EmitMetricArgsForCall(i int) *models.CustomMetric {
	fake.emitMetricMutex.RLock()
	defer fake.emitMetricMutex.RUnlock()
	return fake.emitMetricArgsForCall[i].arg1
}

func (fake *FakeMetricForwarder) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.emitMetricMutex.RLock()
	defer fake.emitMetricMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeMetricForwarder) 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 _ forwarder.MetricForwarder = new(FakeMetricForwarder)
