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

import (
	"sync"

	"code.cloudfoundry.org/garden"
	"code.cloudfoundry.org/guardian/rundmc/runrunc"
)

type FakeStatsNotifier struct {
	OnStatStub        func(string, garden.ContainerCPUStat, garden.ContainerMemoryStat)
	onStatMutex       sync.RWMutex
	onStatArgsForCall []struct {
		arg1 string
		arg2 garden.ContainerCPUStat
		arg3 garden.ContainerMemoryStat
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStatsNotifier) OnStat(arg1 string, arg2 garden.ContainerCPUStat, arg3 garden.ContainerMemoryStat) {
	fake.onStatMutex.Lock()
	fake.onStatArgsForCall = append(fake.onStatArgsForCall, struct {
		arg1 string
		arg2 garden.ContainerCPUStat
		arg3 garden.ContainerMemoryStat
	}{arg1, arg2, arg3})
	fake.recordInvocation("OnStat", []interface{}{arg1, arg2, arg3})
	fake.onStatMutex.Unlock()
	if fake.OnStatStub != nil {
		fake.OnStatStub(arg1, arg2, arg3)
	}
}

func (fake *FakeStatsNotifier) OnStatCallCount() int {
	fake.onStatMutex.RLock()
	defer fake.onStatMutex.RUnlock()
	return len(fake.onStatArgsForCall)
}

func (fake *FakeStatsNotifier) OnStatCalls(stub func(string, garden.ContainerCPUStat, garden.ContainerMemoryStat)) {
	fake.onStatMutex.Lock()
	defer fake.onStatMutex.Unlock()
	fake.OnStatStub = stub
}

func (fake *FakeStatsNotifier) OnStatArgsForCall(i int) (string, garden.ContainerCPUStat, garden.ContainerMemoryStat) {
	fake.onStatMutex.RLock()
	defer fake.onStatMutex.RUnlock()
	argsForCall := fake.onStatArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

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

func (fake *FakeStatsNotifier) 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 _ runrunc.StatsNotifier = new(FakeStatsNotifier)
