using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XYY.PerformanceCount.Standard; 
namespace Controllers
{
    [Route("api/query")]
    [ApiController]
    public class QueryController : ControllerBase
    {
        private readonly IPerformanceDB _performanceDB;
        public QueryController(IPerformanceDB performanceDB)
        {

            _performanceDB = performanceDB;
        }

        [HttpPost]
        public async Task<IReadOnlyCollection<MethodPerformanceModel>> Serach(Query query)
        { 
            return await _performanceDB.QueryLog(query);
        }
    }
}
