package topsql

var _ TopSQLModel = &MockTopSQLModel{}

type MockTopSQLModel struct {
	Returns struct {
		GetTopCPUTimeDigestsWindowed []TopCPUTimeDigestsWindowedRow
		GetNormalizedSQLText         []SQLMetaRow
		ListInstances                []InstanceRow
	}
}

func NewMockTopSQLModel() *MockTopSQLModel {
	return &MockTopSQLModel{}
}

func (m *MockTopSQLModel) SetReturnsGetTopCPUTimeDigestsWindowed(ret []TopCPUTimeDigestsWindowedRow) {
	m.Returns.GetTopCPUTimeDigestsWindowed = ret
}

func (m *MockTopSQLModel) GetTopCPUTimeDigestsWindowed(clusterID uint64, windowSize, topN uint32, beginTs, endTs uint64, instanceID string) ([]TopCPUTimeDigestsWindowedRow, error) {
	return m.Returns.GetTopCPUTimeDigestsWindowed, nil
}

func (m *MockTopSQLModel) SetReturnsGetNormalizedSQLText(ret []SQLMetaRow) {
	m.Returns.GetNormalizedSQLText = ret
}

func (m *MockTopSQLModel) GetNormalizedSQLText(clusterID uint64, sqlDigestList []string) ([]SQLMetaRow, error) {
	return m.Returns.GetNormalizedSQLText, nil
}

func (m *MockTopSQLModel) SetListInstances(ret []InstanceRow) {
	m.Returns.ListInstances = ret
}

func (m *MockTopSQLModel) ListInstances(clusterID, beginTs, endTs uint64) ([]InstanceRow, error) {
	return m.Returns.ListInstances, nil
}
